fixed tests and package vulnerabilities
This commit is contained in:
@@ -3,6 +3,27 @@ const crypto = require('crypto');
|
||||
// Mock crypto module
|
||||
jest.mock('crypto');
|
||||
|
||||
// Mock the logger to prevent winston-daily-rotate-file issues
|
||||
jest.mock('../../../utils/logger', () => ({
|
||||
error: jest.fn(),
|
||||
info: jest.fn(),
|
||||
warn: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
withRequestId: jest.fn(() => ({
|
||||
error: jest.fn(),
|
||||
info: jest.fn(),
|
||||
warn: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
})),
|
||||
}));
|
||||
|
||||
// Mock TwoFactorService to prevent otplib loading
|
||||
jest.mock('../../../services/TwoFactorService', () => ({
|
||||
generateSecret: jest.fn(),
|
||||
verifyToken: jest.fn(),
|
||||
generateQRCode: jest.fn(),
|
||||
}));
|
||||
|
||||
// Mock the entire models module
|
||||
jest.mock('../../../models', () => {
|
||||
const mockUser = {
|
||||
|
||||
Reference in New Issue
Block a user