Skip to content

Typecheck broken on main: AppNav.test.tsx missing jest-dom matcher types #25

Description

@mGasiorek998

What

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    afkEligible for the main agent loopbugSomething isn't workingpriority:1Priority 1 — bugs default here

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions