-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Labels
infrastructureIssues/PRs related to the Repository InfraIssues/PRs related to the Repository Infra
Description
This issue about moving away from Jest to Node.js's Native Test Runner
Why
It would be great if we adopted Node.js's Test Runner (and moved away from Jest) because:
- Way less dependencies
- We only need JSDom to be set before the tests start running
- We can remove all the reporters/coverage generators and other dependencies
- It's way faster and native to Node.js
- It's natively ESM compatible which Jest isn't
- We don't need snapshots nor any fancy Jest functionality
Migration
- We still generate JUnit Test Reports for our GitHub Action
- Mocking of Modules cannot be done on "module name mapping" (https://github.com/nodejs/nodejs.org/blob/main/jest.config.mjs#L15-L17)
- Meaning the mocks we have on
__mocks__folders need to be manually imported when used and need to be changed to use the Mocking API https://nodejs.org/api/test.html#mocking
- Meaning the mocks we have on
- Any usage of
jest.APIs need to be replaced to Node Test Runners APIs - Any usage of
expectneeds to be changed toassert(https://nodejs.org/api/assert.html) - Some pieces of code/tests might also need to be changed
bmuenzenmeyer, AugustinMauroy, demakoff, codyebberson, goggle555 and 6 more
Metadata
Metadata
Assignees
Labels
infrastructureIssues/PRs related to the Repository InfraIssues/PRs related to the Repository Infra