fix: stabilize full gate

This commit is contained in:
Peter Steinberger
2026-03-17 06:53:29 +00:00
parent 026d8ea534
commit 5fb7a1363f
92 changed files with 1381 additions and 838 deletions

View File

@@ -1,6 +1,6 @@
import type { ChildProcess } from "node:child_process";
import { EventEmitter } from "node:events";
import { afterEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const spawnMock = vi.hoisted(() => vi.fn());
@@ -12,7 +12,9 @@ vi.mock("node:child_process", async () => {
};
});
import { runCommandWithTimeout } from "./exec.js";
type ExecModule = typeof import("./exec.js");
let runCommandWithTimeout: ExecModule["runCommandWithTimeout"];
function createFakeSpawnedChild() {
const child = new EventEmitter() as EventEmitter & ChildProcess;
@@ -39,6 +41,11 @@ function createFakeSpawnedChild() {
}
describe("runCommandWithTimeout no-output timer", () => {
beforeEach(async () => {
vi.resetModules();
({ runCommandWithTimeout } = await import("./exec.js"));
});
afterEach(() => {
vi.useRealTimers();
vi.restoreAllMocks();