From e450fed4628f49fb5a28121bc6aa8af4b4b2622b Mon Sep 17 00:00:00 2001 From: prateek Date: Sat, 14 Feb 2026 14:40:44 +0530 Subject: [PATCH] fix: upgrade @testing-library/jest-dom for vitest 2.x type compatibility (#21) The v6.6.0 module augmentation for vitest's Assertion interface was broken with vitest 2.x. Upgrading to v6.9.1 fixes the ~47 typecheck errors (toBeInTheDocument, toHaveAttribute). Also adds vitest.d.ts to ensure the type augmentation is included in tsc compilation. Co-authored-by: Claude Opus 4.6 --- packages/web/package.json | 6 +++--- packages/web/src/vitest.d.ts | 1 + pnpm-lock.yaml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 packages/web/src/vitest.d.ts diff --git a/packages/web/package.json b/packages/web/package.json index fb936f284..805f01feb 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -23,16 +23,16 @@ }, "devDependencies": { "@tailwindcss/postcss": "^4.0.0", - "@testing-library/jest-dom": "^6.6.0", + "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.1.0", "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "@vitejs/plugin-react": "^4.3.0", "jsdom": "^25.0.0", - "tailwindcss": "^4.0.0", - "typescript": "^5.7.0", "playwright": "^1.49.0", + "tailwindcss": "^4.0.0", "tsx": "^4.19.0", + "typescript": "^5.7.0", "vitest": "^2.1.0" } } diff --git a/packages/web/src/vitest.d.ts b/packages/web/src/vitest.d.ts new file mode 100644 index 000000000..f149f27ae --- /dev/null +++ b/packages/web/src/vitest.d.ts @@ -0,0 +1 @@ +import "@testing-library/jest-dom/vitest"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4956f6338..1d134fa54 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -338,7 +338,7 @@ importers: specifier: ^4.0.0 version: 4.1.18 '@testing-library/jest-dom': - specifier: ^6.6.0 + specifier: ^6.9.1 version: 6.9.1 '@testing-library/react': specifier: ^16.1.0