test: dedupe and optimize test suites

This commit is contained in:
Peter Steinberger
2026-02-19 15:18:50 +00:00
parent b0e55283d5
commit a1cb700a05
80 changed files with 2627 additions and 2962 deletions

View File

@@ -38,7 +38,7 @@ describe("runCommandWithTimeout", () => {
it("kills command when no output timeout elapses", async () => {
const result = await runCommandWithTimeout(
[process.execPath, "-e", "setTimeout(() => {}, 1_000)"],
[process.execPath, "-e", "setTimeout(() => {}, 120)"],
{
timeoutMs: 1_000,
noOutputTimeoutMs: 35,
@@ -55,11 +55,11 @@ describe("runCommandWithTimeout", () => {
[
process.execPath,
"-e",
'let i=0; const t=setInterval(() => { process.stdout.write("."); i += 1; if (i >= 2) { clearInterval(t); process.exit(0); } }, 5);',
'process.stdout.write("."); setTimeout(() => process.stdout.write("."), 30); setTimeout(() => process.exit(0), 60);',
],
{
timeoutMs: 1_000,
noOutputTimeoutMs: 120,
noOutputTimeoutMs: 500,
},
);
@@ -72,7 +72,7 @@ describe("runCommandWithTimeout", () => {
it("reports global timeout termination when overall timeout elapses", async () => {
const result = await runCommandWithTimeout(
[process.execPath, "-e", "setTimeout(() => {}, 1_000)"],
[process.execPath, "-e", "setTimeout(() => {}, 120)"],
{
timeoutMs: 15,
},