ryosei-f 2 недель назад
Родитель
Сommit
2fc4724b15

+ 4 - 5
apps/app/src/features/audit-log-bulk-export/server/routes/apiv3/audit-log-bulk-export.integ.ts

@@ -3,7 +3,6 @@ import express, {
   type Request,
   type Request,
   type Response,
   type Response,
 } from 'express';
 } from 'express';
-import mockRequire from 'mock-require';
 import request from 'supertest';
 import request from 'supertest';
 import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
 import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
 
 
@@ -14,11 +13,11 @@ import * as ServiceModule from '../../service/audit-log-bulk-export';
 import { auditLogBulkExportService } from '../../service/audit-log-bulk-export';
 import { auditLogBulkExportService } from '../../service/audit-log-bulk-export';
 import { factory } from './audit-log-bulk-export';
 import { factory } from './audit-log-bulk-export';
 
 
-mockRequire('~/server/middlewares/login-required', () => {
-  return (_req: Request, _res: Response, next: NextFunction) => {
+vi.mock('~/server/middlewares/login-required', () => ({
+  default: () => (_req: Request, _res: Response, next: NextFunction) => {
     next();
     next();
-  };
-});
+  },
+}));
 
 
 vi.mock('~/server/middlewares/apiv3-form-validator', () => {
 vi.mock('~/server/middlewares/apiv3-form-validator', () => {
   const { validationResult } = require('express-validator');
   const { validationResult } = require('express-validator');