-
Notifications
You must be signed in to change notification settings - Fork 69
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
Jest ESM #1247
Comments
Needs to be done after #1264 since it enables ESM on nextjs |
Things for the engineers to be aware of:
|
Here's what I did:
"scripts": {
"..."
"test": "TZ=UTC node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --runInBand",
"..."
},
extensionsToTreatAsEsm: ['.ts', '.jsx', '.tsx']
import { jest } from '@jest/globals'
"scripts": {
"..."
"ts-node": "ts-node-dev --compiler-options {\\\"module\\\":\\\"CommonJS\\\"}",
"..."
}, Main errors to be fixed:
18 | import Title from '../../../../components/Title'
19 | jest.mock('../../../../components/Title', () => {
> 20 | return jest.fn(() => null)
| ^^^^
21 | })
22 | import {
23 | getSubLessonSlugs,
|
We'll wait for jestjs/jest#10976 and jestjs/jest#9430 to be resolved. Then we can continue from where we stopped. |
labeled as blocked and closing for now. We'll tackle this when this becomes an issue again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fix Jest + Typescript + ESM. Currently our
jest
does not supportesm
, which results in hacks like these, which mocks out the library instead of generating snapshots with them.The text was updated successfully, but these errors were encountered: