From f00b69621fd73ec357de92e1661f63cd2a08c408 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Wed, 25 Mar 2026 22:26:35 -0600 Subject: [PATCH] fix(tests): replace undefined assertTrue/assertEq with assert.ok/deepStrictEqual These test files imported `assert` from node:assert/strict but used assertTrue/assertEq (from test-helpers.ts createTestContext) without importing them, breaking typecheck:extensions on main and all PRs. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../gsd/tests/doctor-environment.test.ts | 16 ++++++++-------- .../extensions/gsd/tests/doctor-git.test.ts | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/resources/extensions/gsd/tests/doctor-environment.test.ts b/src/resources/extensions/gsd/tests/doctor-environment.test.ts index 59263f2b7..de53efa6a 100644 --- a/src/resources/extensions/gsd/tests/doctor-environment.test.ts +++ b/src/resources/extensions/gsd/tests/doctor-environment.test.ts @@ -143,8 +143,8 @@ describe('doctor-environment', async () => { cleanups.push(dir); const results = runEnvironmentChecks(dir); const depsCheck = results.find(r => r.name === "dependencies"); - assertTrue(depsCheck !== undefined, "dependencies check runs"); - assertEq(depsCheck!.status, "ok", "npm marker newer than lockfile → not stale"); + assert.ok(depsCheck !== undefined, "dependencies check runs"); + assert.deepStrictEqual(depsCheck!.status, "ok", "npm marker newer than lockfile → not stale"); } console.log("\n=== env: yarn marker file newer than lockfile → ok (#1974) ==="); @@ -167,8 +167,8 @@ describe('doctor-environment', async () => { cleanups.push(dir); const results = runEnvironmentChecks(dir); const depsCheck = results.find(r => r.name === "dependencies"); - assertTrue(depsCheck !== undefined, "dependencies check runs"); - assertEq(depsCheck!.status, "ok", "yarn marker newer than lockfile → not stale"); + assert.ok(depsCheck !== undefined, "dependencies check runs"); + assert.deepStrictEqual(depsCheck!.status, "ok", "yarn marker newer than lockfile → not stale"); } console.log("\n=== env: pnpm marker file newer than lockfile → ok (#1974) ==="); @@ -191,8 +191,8 @@ describe('doctor-environment', async () => { cleanups.push(dir); const results = runEnvironmentChecks(dir); const depsCheck = results.find(r => r.name === "dependencies"); - assertTrue(depsCheck !== undefined, "dependencies check runs"); - assertEq(depsCheck!.status, "ok", "pnpm marker newer than lockfile → not stale"); + assert.ok(depsCheck !== undefined, "dependencies check runs"); + assert.deepStrictEqual(depsCheck!.status, "ok", "pnpm marker newer than lockfile → not stale"); } console.log("\n=== env: no marker file falls back to dir mtime → stale warning (#1974) ==="); @@ -212,8 +212,8 @@ describe('doctor-environment', async () => { cleanups.push(dir); const results = runEnvironmentChecks(dir); const depsCheck = results.find(r => r.name === "dependencies"); - assertTrue(depsCheck !== undefined, "dependencies check runs"); - assertEq(depsCheck!.status, "warning", "no marker + lockfile newer → stale warning"); + assert.ok(depsCheck !== undefined, "dependencies check runs"); + assert.deepStrictEqual(depsCheck!.status, "warning", "no marker + lockfile newer → stale warning"); } // ── Env File Check ───────────────────────────────────────────────── diff --git a/src/resources/extensions/gsd/tests/doctor-git.test.ts b/src/resources/extensions/gsd/tests/doctor-git.test.ts index eabb2daf5..cdffe17ae 100644 --- a/src/resources/extensions/gsd/tests/doctor-git.test.ts +++ b/src/resources/extensions/gsd/tests/doctor-git.test.ts @@ -167,22 +167,22 @@ describe('doctor-git', async () => { const fixed = await runGSDDoctor(dir, { fix: true, isolationMode: "worktree" }); // The fix must NOT skip removal — it should chdir out and remove - assertTrue( + assert.ok( !fixed.fixesApplied.some(f => f.includes("skipped removing worktree")), "does NOT skip removal when cwd is inside worktree", ); - assertTrue( + assert.ok( fixed.fixesApplied.some(f => f.includes("removed orphaned worktree")), "removes orphaned worktree even when cwd was inside it", ); // Verify worktree is gone const wtList = run("git worktree list", dir); - assertTrue(!wtList.includes("milestone/M001"), "worktree removed after fix with cwd inside"); + assert.ok(!wtList.includes("milestone/M001"), "worktree removed after fix with cwd inside"); // Verify cwd was moved out (should be basePath, not still inside worktree) const newCwd = process.cwd(); - assertTrue( + assert.ok( !newCwd.startsWith(wtPath), "cwd moved out of worktree after fix", );