This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

test: fix 6 pre-existing typecheck errors so `npm run typecheck` is clean (#64)

The suite passes at runtime (vitest strips types), but `npm run typecheck`
(tsc over src+tests) was red with 6 errors that CI never caught — nix.yml
only runs `nix build` (src-only), not typecheck or vitest.

- tests/tui-framework.test.ts (x4): ScreenContext render mocks predated the
focus-manager work and were missing the now-required quit/focus fields.
Completed each mock (quit no-op + createFocusManager()).
- tests/exec.test.ts, tests/nesting.test.ts: `{ ...process.env, PTY_SESSION_DIR }`
loses the index signature, so `delete env.PTY_SESSION` didn't typecheck.
Annotated env as Record<string, string | undefined> (same pattern the other
test helpers already use).

Verified: `npm run typecheck` clean (0 errors); the 3 files pass at runtime
(95 tests).

authored by

Nathan and committed by
GitHub
(Jul 9, 2026, 11:00 AM +0200) 238ca69f 8da8717f

+7 -3
+1 -1
tests/exec.test.ts
··· 109 109 110 110 it("errors when not inside a pty session", () => { 111 111 const dir = makeSessionDir(); 112 - const env = { ...process.env, PTY_SESSION_DIR: dir }; 112 + const env: Record<string, string | undefined> = { ...process.env, PTY_SESSION_DIR: dir }; 113 113 delete env.PTY_SESSION; 114 114 115 115 const result = spawnSync(nodeBin, [cliPath, "exec", "--", "echo", "hi"], {
+1 -1
tests/nesting.test.ts
··· 191 191 const name = uniqueName(); 192 192 193 193 // Remove PTY_SESSION from env explicitly 194 - const env = { ...process.env, PTY_SESSION_DIR: dir }; 194 + const env: Record<string, string | undefined> = { ...process.env, PTY_SESSION_DIR: dir }; 195 195 delete env.PTY_SESSION; 196 196 197 197 const result = spawnSync(nodeBin, [cliPath, "run", "-d", "--id", name, "--", "cat"], {
+5 -1
tests/tui-framework.test.ts
··· 7 7 groupedSelectable, statusBar, footer, askBar, textInput, fpsCounter, 8 8 canvas, screen, overlay, 9 9 layoutRoot, layoutVertical, layoutRow, textWidth, 10 - renderToAnsi, resolveColor, 10 + renderToAnsi, resolveColor, createFocusManager, 11 11 type UINode, type RenderOpts, 12 12 } from "../src/tui/index.ts"; 13 13 import { CellBuffer } from "../src/tui/buffer.ts"; ··· 509 509 navigate: () => {}, back: () => {}, 510 510 openOverlay: () => {}, closeOverlay: () => {}, 511 511 isTextInputActive: () => false, setTextInputActive: () => {}, 512 + quit: () => {}, focus: createFocusManager(), 512 513 }; 513 514 const buf = myScreen.renderToBuffer(ctx); 514 515 const line0 = buf.cells[0].map(c => c.char).join("").trim(); ··· 549 550 navigate: () => {}, back: () => {}, 550 551 openOverlay: () => {}, closeOverlay: () => {}, 551 552 isTextInputActive: () => false, setTextInputActive: () => {}, 553 + quit: () => {}, focus: createFocusManager(), 552 554 }; 553 555 const buf = myScreen.renderToBuffer(ctx); 554 556 // "Hello" (chars 0-4) should be bold + accent color ··· 578 580 navigate: () => {}, back: () => {}, 579 581 openOverlay: () => {}, closeOverlay: () => {}, 580 582 isTextInputActive: () => false, setTextInputActive: () => {}, 583 + quit: () => {}, focus: createFocusManager(), 581 584 }; 582 585 const buf = myScreen.renderToBuffer(ctx); 583 586 // Word-wrap: "AAA" / " BBB" / " CCC" (breaks before spaces) ··· 612 615 navigate: () => {}, back: () => {}, 613 616 openOverlay: () => {}, closeOverlay: () => {}, 614 617 isTextInputActive: () => false, setTextInputActive: () => {}, 618 + quit: () => {}, focus: createFocusManager(), 615 619 }; 616 620 const buf = myScreen.renderToBuffer(ctx); 617 621 expect(buf.cells[0][0].bold).toBe(true);