fix: add comment explaining process.exit mock pattern per review
This commit is contained in:
@@ -82,6 +82,8 @@ describe("nerve sense trigger (e2e mock daemon)", () => {
|
||||
|
||||
vi.spyOn(process, "exit").mockImplementation((code?: number | string | null) => {
|
||||
const c = typeof code === "number" ? code : 1;
|
||||
// Throw instead of actually exiting so the test runner stays alive;
|
||||
// the test asserts on this message to verify the exit code.
|
||||
throw new Error(`process.exit(${String(c)})`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user