lootsa tests fixes
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 6m13s

This commit is contained in:
2025-12-05 15:39:55 -08:00
parent 5cf1e610b3
commit 24ec00113f
9 changed files with 179 additions and 110 deletions

View File

@@ -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() },
};
});