many fixes resultnig from latest refactoring
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 5m46s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 5m46s
This commit is contained in:
@@ -54,7 +54,7 @@ type PassportCallback = (error: Error | null, user: Express.User | false, info?:
|
||||
// Mock Passport middleware
|
||||
vi.mock('./passport.routes', () => ({
|
||||
default: {
|
||||
authenticate: (strategy: string, options: Record<string, unknown>, callback: PassportCallback) => (req: Request, res: any, next: any) => {
|
||||
authenticate: (strategy: string, options: Record<string, unknown>, callback: PassportCallback) => (req: Request, res: any) => {
|
||||
// Logic to simulate passport authentication outcome based on test input
|
||||
if (req.body.password === 'wrong_password') {
|
||||
// Simulate incorrect credentials
|
||||
@@ -84,7 +84,7 @@ app.use(cookieParser()); // Add cookie-parser middleware to populate req.cookies
|
||||
app.use('/api/auth', authRouter);
|
||||
|
||||
// Add error handler to catch and log 500s during tests
|
||||
app.use((err: any, req: Request, res: any, next: any) => {
|
||||
app.use((err: any, req: Request, res: any) => {
|
||||
console.error('[TEST APP ERROR]', err);
|
||||
res.status(500).json({ message: err.message });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user