fix(FN-4642): harden container backend against child_process mocks
Fusion-Task-Id: FN-4642 Fusion-Task-Lineage: a42a36f8-2d2a-43fe-b7c1-d7cf1ad321c3
This commit is contained in:
committed by
gsxdsm
parent
6998ac4edd
commit
8955db96e2
@@ -8,11 +8,15 @@ const { mockExec, mockExecFile } = vi.hoisted(() => ({
|
||||
mockExecFile: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("node:child_process", () => ({
|
||||
exec: mockExec,
|
||||
execFile: mockExecFile,
|
||||
spawn: vi.fn(),
|
||||
}));
|
||||
vi.mock("node:child_process", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("node:child_process")>();
|
||||
return {
|
||||
...actual,
|
||||
exec: mockExec,
|
||||
execFile: mockExecFile,
|
||||
spawn: vi.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
describe("ContainerSandboxBackend", () => {
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user