From e05b0695b8400459eece3a61d9b2e5fc0de7999a Mon Sep 17 00:00:00 2001 From: Jory Irving Date: Thu, 3 Sep 2026 21:15:58 -0600 Subject: [PATCH] fix(types): point at jest-dom's vitest matcher types tsconfig referenced @testing-library/jest-dom, whose default entry augments jest's Assertion interface. The setup file already imports the vitest entry, so the matchers exist at runtime and the types happened to resolve under vitest 4. Under vitest 5 they do not: every toBeInTheDocument becomes TS2339, which is the whole of the failure on the vitest 5.0.0 bump. Referencing the /vitest entry registers the augmentation vitest actually uses. Verified against both: typecheck and 2528 tests pass on vitest 4, and on a worktree with vitest 5.0.0 installed typecheck is clean and 2493 tests pass. --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 87504101..4d70053e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,7 @@ "plugins": [{ "name": "next" }], "paths": { "@/*": ["./src/*"] }, "target": "ES2022", - "types": ["@testing-library/jest-dom"] + "types": ["@testing-library/jest-dom/vitest"] }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"], "exclude": ["node_modules", "vitest.config.*", "vitest.setup.*"]