-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade vitest and some related packages #3482
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,6 @@ | |
"tsx": "^4.7.1", | ||
"typescript": "5.5.4", | ||
"unified": "10.1.2", | ||
"vitest": "^1.2.2" | ||
"vitest": "^2.1.8" | ||
} | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixes type errors when using the matchers from @testing-library/jest-dom, e.g. The docs says the old method should still work though 🤷♂️ https://github.com/testing-library/jest-dom/releases/tag/v6.0.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1 @@ | ||
/** | ||
* Setup-file is required to avoid "chai" type errors when using testing-library with vitest | ||
*/ | ||
import matchers from "@testing-library/jest-dom/matchers"; | ||
import { expect } from "vitest"; | ||
|
||
expect.extend(matchers); | ||
import "@testing-library/jest-dom/vitest"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,11 @@ | |
"declaration": true, | ||
"sourceMap": true | ||
}, | ||
"include": ["./src"] | ||
"include": ["./src"], | ||
"exclude": [ | ||
"./src/**/*.test.ts", | ||
"./src/**/*.test.tsx", | ||
"./src/**/*.test-d.ts", | ||
"./src/**/*.stories.tsx" | ||
] | ||
Comment on lines
+11
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added to fix these errors:
This could also be fixed by adding |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
"extends": "../../../tsconfig.json", | ||
"compilerOptions": { | ||
"noImplicitAny": false, | ||
"resolveJsonModule": true | ||
"resolveJsonModule": true, | ||
"types": ["vitest/globals"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes type errors when using test(), expect() etc, e.g. Not sure why it wasn't needed before. |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
act()
from multiple tests because it gave this warning:The current testing environment is not configured to support act(...)
Tests seems to work fine without it 🤷♂️