-
Notifications
You must be signed in to change notification settings - Fork 279
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
test: switch from jest to vitest #1406
Conversation
± Registry diff
📊 PerformanceKeyNote that each bar component rounds up to the nearest 100ms, so each full bar is an overestimate by up to 400ms.
Data
|
Deploying with Cloudflare Pages
|
I'm probably misremembering; did you say there's a lint that allows us to enforce the |
Yeah https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/file-extension-in-import.md |
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.
Thanks for doing this Nimo! I'm cool with merging this PR under the following caveats:
- see the minor comment I left above about
codecov.yml
- we should open an issue about actually running Edgeworth tests in CI
- we should open an issue about the canvas warnings in Edgeworth tests
- we should open an issue about switching from
"moduleResolution": "node"
to"moduleResolution": "node16"
inoptimizer
,components
,edgeworth
, andeditor
I no longer think we need to bother adding such a lint, because this is automatically enforced by TypeScript when we set |
|
Description
This PR switches our testing framework from jest to vitest, which is ESM-first and much faster.
Implementation strategy and design decisions
core
, we switched all imports incore
to include the.js
file extension.core
andedgeworth
to vitest and they worked well locally. However,edgeworth
's tests seemed to hang the CI. Sincemain
only runs coverage oncore
anyway, this PR won't change the behavior of the test script.Examples with steps to reproduce them
Checklist
Open questions
edgeworth
tests hang CI? Seems like a known issue: Vitest hangs tests, close timed out after 1000ms vitest-dev/vitest#2008canvas
related error whenever I run tests. This is reported in Expose CanvasRenderingContext2D via thecanvas
package vitest-dev/vitest#274 and a plugin will be needed for this. We don't actually produce diagrams in the tests, so this is really just an artifact of us doing mathjax initialization at the top level inCollectLabels
.