moar unit test !
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 6m41s

This commit is contained in:
2025-12-08 08:53:17 -08:00
parent ed75e9dd77
commit 66a2585efc
8 changed files with 82 additions and 73 deletions

View File

@@ -40,13 +40,15 @@ vi.mock('node:fs/promises', () => ({
vi.mock('../services/backgroundJobService');
vi.mock('../services/geocodingService.server');
vi.mock('../services/queueService.server');
vi.mock('@bull-board/api');
vi.mock('@bull-board/api/bullMQAdapter');
vi.mock('@bull-board/api'); // Keep this mock for the API part
vi.mock('@bull-board/api/bullMQAdapter'); // Keep this mock for the adapter
// Fix: Mock ExpressAdapter as a class to allow `new ExpressAdapter()` to work.
vi.mock('@bull-board/express', () => ({
ExpressAdapter: vi.fn().mockImplementation(() => ({
setBasePath: vi.fn(),
getRouter: () => (req: Request, res: Response, next: NextFunction) => next(),
})),
ExpressAdapter: class {
setBasePath = vi.fn();
getRouter = vi.fn().mockReturnValue((req: Request, res: Response, next: NextFunction) => next());
},
}));
// Import the mocked modules to control them