The TypeScript part of tabctl no longer has first-class tests, at least not in a way that is wired into package.json and the normal checks.
I ran into this while addressing review comments in background.ts. AGENTS.md still refers to src/tests/unit and extension tests with a chrome stub, and we still have build/tests/unit artifacts, but the source tests and the test runner are not in the repo anymore. npm test and npm run test:unit only run Rust tests right now.
Why
This makes changes in the TypeScript code a bit awkward. Rust tests and browser integration tests cover a lot, and that works well, but for logic in src/extension/background.ts and the other TS files we are missing the fast feedback loop for small regressions.
What
Bring back a small first-class TS unit test setup for the extension and shared TS code, wired into the normal local checks. I do not think this needs to be very big, just enough to test pure logic and chrome-facing helpers with lightweight stubs.
A couple of concrete things:
- decide what the supported TS unit test surface is
- add a test runner and wire it into
package.json and the hooks
- either restore or replace the old
src/tests/unit setup
- update
AGENTS.md and any other docs so they match reality again
- add a couple of tests around browser-state sync, reconnect behaviour, and incognito handling, this kind of thing is exactly where the missing tests hurt
Definition of done
- TS tests live in the repository, not only as generated build artifacts
- there is a command in
package.json that runs them
- the command is part of normal verification
- docs describe the real setup
The TypeScript part of
tabctlno longer has first-class tests, at least not in a way that is wired intopackage.jsonand the normal checks.I ran into this while addressing review comments in
background.ts.AGENTS.mdstill refers tosrc/tests/unitand extension tests with a chrome stub, and we still havebuild/tests/unitartifacts, but the source tests and the test runner are not in the repo anymore.npm testandnpm run test:unitonly run Rust tests right now.Why
This makes changes in the TypeScript code a bit awkward. Rust tests and browser integration tests cover a lot, and that works well, but for logic in
src/extension/background.tsand the other TS files we are missing the fast feedback loop for small regressions.What
Bring back a small first-class TS unit test setup for the extension and shared TS code, wired into the normal local checks. I do not think this needs to be very big, just enough to test pure logic and chrome-facing helpers with lightweight stubs.
A couple of concrete things:
package.jsonand the hookssrc/tests/unitsetupAGENTS.mdand any other docs so they match reality againDefinition of done
package.jsonthat runs them