lootsa tests fixes
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 6m13s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 6m13s
This commit is contained in:
@@ -8,12 +8,13 @@ import systemRouter from './system.routes';
|
||||
// Define a type for the exec callback to avoid using `any`.
|
||||
type ExecCallback = (error: ExecException | null, stdout: string, stderr: string) => void;
|
||||
|
||||
// FIX: Add default export to child_process mock
|
||||
vi.mock('child_process', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('child_process')>();
|
||||
// Mock the 'child_process' module.
|
||||
vi.mock('child_process', () => {
|
||||
return {
|
||||
...actual, // Spread all original exports.
|
||||
exec: vi.fn(), // Override only the 'exec' function with a mock.
|
||||
// Mock the named export 'exec'.
|
||||
exec: vi.fn(),
|
||||
// Also mock the default export if it's used elsewhere.
|
||||
default: { exec: vi.fn() },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user