diff --git a/frontend/src/install.test.ts b/frontend/src/install.test.ts index f048fc6..3c21f3f 100644 --- a/frontend/src/install.test.ts +++ b/frontend/src/install.test.ts @@ -131,7 +131,7 @@ describe("Windows uninstall ownership", () => { } finally { rmSync(directory, { recursive: true, force: true }); } - }); + }, 30_000); } }); diff --git a/frontend/src/installerOutput.test.ts b/frontend/src/installerOutput.test.ts index 42ac8ab..218e85a 100644 --- a/frontend/src/installerOutput.test.ts +++ b/frontend/src/installerOutput.test.ts @@ -97,9 +97,9 @@ for (const [name, path, server] of [ $errors = $null [System.Management.Automation.Language.Parser]::ParseFile($env:TEST_SCRIPT, [ref]$tokens, [ref]$errors) > $null if ($errors.Count) { $errors | ForEach-Object { Write-Error $_ }; exit 1 } - `], { env: { ...process.env, TEST_SCRIPT: file }, encoding: "utf8" }); + `], { env: { ...process.env, TEST_SCRIPT: file }, encoding: "utf8", timeout: 10_000 }); expect(result.status).toBe(0); - }); + }, 30_000); test.skipIf(!powershell)("separates fresh-install guidance from update results", () => { const states = server ? [[true, false, false], [false, false, false]] : [ @@ -120,7 +120,7 @@ for (const [name, path, server] of [ $Port = 3100 Write-Step "正在启动服务" Show-InstallResult - `], { encoding: "utf8" }); + `], { encoding: "utf8", timeout: 10_000 }); expect(result.status).toBe(0); const output = result.stdout.replaceAll("\r\n", "\n"); if (fresh) { @@ -130,6 +130,6 @@ for (const [name, path, server] of [ expect(output).toBe("正在启动服务\n\n更新完成(v1.2.3)\n"); } } - }); + }, 30_000); }); } diff --git a/frontend/src/updateSafety.test.ts b/frontend/src/updateSafety.test.ts index 27e70e5..c468e85 100644 --- a/frontend/src/updateSafety.test.ts +++ b/frontend/src/updateSafety.test.ts @@ -239,7 +239,7 @@ describe("Windows update process lifecycle", () => { `], { env: { ...process.env, TEST_MODE: mode }, encoding: "utf8", timeout: 10_000 }); expect(result.status).toBe(mode === "stops" ? 0 : 1); expect(result.stdout.trim()).toBe(mode === "stops" ? "replaced:2" : "blocked"); - }); + }, 30_000); } } @@ -271,5 +271,5 @@ describe("Windows update process lifecycle", () => { } finally { rmSync(directory, { recursive: true, force: true }); } - }); + }, 30_000); });