You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typecheck broken on main: AppNav.test.tsx missing jest-dom matcher types #25
pnpm typecheck (and therefore pnpm verify) fails on main with the following errors in apps/web/src/components/AppNav.test.tsx:
src/components/AppNav.test.tsx(18,45): error TS2339: Property 'toBeInTheDocument' does not exist on type 'Assertion<any>'.
src/components/AppNav.test.tsx(24,20): error TS2339: Property 'toHaveAttribute' does not exist on type 'Assertion<any>'.
... (9 total)
Why it happens
apps/web/src/test/setup.ts imports @testing-library/jest-dom which extends matchers at runtime, but apps/web/tsconfig.json has "types": ["vite/client"] and never pulls in the jest-dom type augmentations, so vitest's Assertion interface is unaware of toBeInTheDocument / toHaveAttribute.
Introduced by PR #24 (commit 5dea359 feat(green): AppNav left-sidebar navigation) — the runtime setup was added, the type bridge was not.
Reproduction
git checkout main
pnpm typecheck
Fails immediately in @medbridge/web typecheck.
Proposed failing test
There is no code-level test to add — pnpm typecheck is the test, and it is red on main today. The fix is verified when pnpm typecheck exits 0.
Proposed fix
Add "@testing-library/jest-dom" to apps/web/tsconfig.json's types array (or import '@testing-library/jest-dom/vitest' in src/test/setup.ts so the augmentation registers under vitest's Assertion). Either way, ensure @testing-library/jest-dom is a devDependency of apps/web.
Why this matters now
The agent loop runs pnpm verify before every commit. With main failing typecheck, new feature work cannot satisfy the gate cleanly. Filed from issue #19's iteration; #19's PR will note that verify cannot pass cleanly until this is resolved on main.
Update: there is also a missing devDependency on jsdom — pnpm test for @medbridge/web fails with MISSING DEPENDENCY Cannot find dependency 'jsdom'. Same root cause (PR #24 added a vitest jsdom config and a setup file but did not add the runtime/type deps). Both fix as one: install @testing-library/jest-dom and jsdom as devDependencies in apps/web, switch the setup import to @testing-library/jest-dom/vitest so vitest's Assertion gets augmented (no tsconfig change needed).
False alarm — @testing-library/jest-dom and jsdom are already declared as devDependencies in apps/web/package.json (added by PR #24). My local node_modules were stale; running pnpm install syncs them and pnpm verify passes cleanly. Closing as not-a-bug. Apologies for the noise.
Activity
mGasiorek998 commentedon May 7, 2026
Update: there is also a missing devDependency on jsdom —
pnpm testfor @medbridge/web fails withMISSING DEPENDENCY Cannot find dependency 'jsdom'. Same root cause (PR #24 added a vitest jsdom config and a setup file but did not add the runtime/type deps). Both fix as one: install@testing-library/jest-domandjsdomas devDependencies in apps/web, switch the setup import to@testing-library/jest-dom/vitestso vitest's Assertion gets augmented (no tsconfig change needed).mGasiorek998 commentedon May 7, 2026
False alarm —
@testing-library/jest-domandjsdomare already declared as devDependencies inapps/web/package.json(added by PR #24). My local node_modules were stale; runningpnpm installsyncs them andpnpm verifypasses cleanly. Closing as not-a-bug. Apologies for the noise.