Open History to see the last commit
1import assert from "node:assert/strict";
2import { readFile } from "node:fs/promises";
3import test from "node:test";
4
5const read = (path) => readFile(new URL(`../${path}`, import.meta.url), "utf8");
6
7test("packaged smoke branches the real Electron main entry", async () => {
8 const [main, smoke] = await Promise.all([
9 read("apps/desktop/src/main.ts"),
10 read("apps/desktop/src/app/DesktopPackagedSmoke.ts"),
11 ]);
12 assert.match(main, /DesktopPackagedSmoke\.isPackagedSmokeRequested\(\)/);
13 assert.match(smoke, /environment\.isPackaged/);
14 assert.match(smoke, /primary\.start/);
15 assert.match(smoke, /waitForReady/);
16 assert.match(smoke, /wslBackend\.retry/);
17 assert.match(smoke, /runningDistro/);
18 assert.match(smoke, /stopAll/);
19 assert.match(smoke, /afterFirstStop/);
20 assert.match(smoke, /restartCycle/);
21 assert.match(smoke, /activePid/);
22});
23
24test("Windows launcher uses hostile path characters and validates shutdown", async () => {
25 const script = await read("scripts/run-windows-packaged-lifecycle-smoke.ps1");
26 assert.match(script, /T3 Code José QA/);
27 assert.match(script, /artifact üñíçødé path/);
28 assert.match(script, /state home Ω/);
29 assert.match(script, /Assert-ProcessGone/);
30 assert.match(script, /Assert-PortBindable/);
31 assert.match(script, /TcpClient/);
32 assert.match(script, /T3CODE_DESKTOP_PACKAGED_SMOKE_WSL_DISTRO/);
33});
34
35test("CI builds and launches a portable packaged artifact after real WSL2 setup", async () => {
36 const ci = await read(".github/workflows/ci.yml");
37 assert.match(ci, /Windows \+ real WSL2 \+ Packaged Lifecycle/);
38 assert.match(ci, /--target portable/);
39 assert.match(ci, /--wsl-prebuild/);
40 assert.match(ci, /run-windows-packaged-lifecycle-smoke\.ps1/);
41 assert.match(ci, /windows-packaged-lifecycle-smoke/);
42});