Tests: fix happy-dom types + bun install wiring so bunx tsc --noEmit passes on main #130
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#130
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a developer, I want
bunx tsc --noEmitto exit 0 onmainso that every branch's QA isn't perpetually red and I can trust the typecheck gate.Context
PR #121 added
src/dashboard-browser.test.tswhich imports fromhappy-dom, but the package declaration wasn't properly wired into the project. Currentmainoutput:Every PR opened since #121 merged ships with this failing typecheck, and reviewers have been noting "pre-existing, not blocking" — the signal is lost.
Acceptance criteria
bunx tsc --noEmitexits 0 onmainafter this PR.happy-domis declared correctly — either inpackage.jsondependencies (if missing) or via the right@types//devDependenciesentry so the import resolves.'el' is of type 'unknown'error at line 202 is fixed (narrow the type at the source rather thanas any).bun test src/dashboard-browser.test.tsstill passes — the TS fix must not change runtime behaviour.just qaexits 0 end-to-end after this PR (modulo the one pre-existingDELETE wipe=trueflake, which is env-dependent and out of scope).Out of scope
DELETE /agents wipe=trueflake that assumes no docker daemon in the test env — separate ticket.References
src/dashboard-browser.test.ts.typecheckrecipe: bunx tsc --noEmit.Dependencies
main.Investigation result — already fully passing ✅
I investigated the issue and ran the full acceptance check against current
main(445542e). All criteria are already met — no code changes required.What I found:
happy-dominpackage.jsondevDependencies"happy-dom": "^18.0.1"present since commit26f4014(PR #121)bun.lockcontains resolved entryhappy-dom@18.0.1bun install --frozen-lockfilesucceedsbun x tsc --noEmitexits 0TS2307: Cannot find module 'happy-dom'lib/index.d.tsresolves viamoduleResolution: bundlerTS18046: 'el' is of type 'unknown'at line 202querySelectorAllreturnsNodeList<Element>in happy-dom's typesbun test src/dashboard-browser.test.tsbun testsuitemain(#1698)Conclusion: The errors described in the issue body were presumably present in an intermediate state (possibly when PR #121 was authored but before
happy-domwas added to the lockfile). By the time the PR merged, the package entry was already in place, andmainhas been green since.Closing as resolved — nothing left to fix.