Skip to content

packages/*/test-bun/ is not covered by npm run typecheck #2995

Description

@acoliver

What happened?

Bun-native test files under packages/cli/test-bun/ are not covered by npm run typecheck.

packages/cli/tsconfig.json has an include list of only index.ts and src/**, so nothing in test-bun/ is ever fed to tsc --noEmit. The same applies to packages/agents/test-bun/.

What did you expect to happen?

Type errors in Bun test files should fail npm run typecheck like any other TypeScript in the repo.

Anything else we need to know?

Practical impact today is limited but real: these files import production types (TextBuffer, Key, InputHandlerDeps, KeyBinding, …). If a production interface changes shape, a stale test fixture will not be flagged by typecheck. It will still fail at runtime under bun test, so the error surfaces — just later and with a worse message than a type error would give.

Affected directories:

  • packages/cli/test-bun/settingsStorage.bun.ts, iContentToHistoryItems.issue2511.bun.ts, steerKey.win32.bun.ts, steerKey.darwin.bun.ts, steerKey.fixture.ts, resolveKeyBindings.bun.ts
  • packages/agents/test-bun/generatingModelStamp.issue2511.bun.ts, subagentAnthropicTextSettings.issue1738.bun.ts

Two options:

  1. Add test-bun/**/*.ts to each package's tsconfig include. Needs bun-types available so bun:test imports resolve, and the files sit outside rootDir so that may need adjusting.
  2. Add a dedicated tsconfig.test-bun.json per package and wire it into the typecheck script as a second tsc --noEmit -p pass. Keeps the build tsconfig clean.

Option 2 is probably tidier given the rootDir constraint.

Note this is pre-existing — test-bun/ has never been typechecked. Raised while working #2951 / #2992, where new files were added to that directory and the gap was noticed during review.

Metadata

Metadata

Assignees

Labels

ci/cdIssues with github and the workflow scripts and CI CD environment.

Type

Projects

Status
In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions