Update test config to leverage swc (#28400)
This updates our `jest` configuration to no longer use `babel-jest` and instead uses `@swc/jest` which is much faster. This also updates to the latest version of `jest`, fixes our `tsconfig.json` used for tests (previously types in `node_modules` weren't resolved correctly), and ensures `next/dist` isn't un-necessarily transpiled in `jest`. Timings for `yarn testheadless test/unit/` on CI - before: 3m 30s - 4m ([example run](https://github.com/vercel/next.js/runs/3394701995)) - after: under 1m ([example run](https://github.com/vercel/next.js/pull/28400/checks?check_run_id=3395161621)) Timings for `yarn testheadless test/unit/` locally on m1 mac - before: 90.16 seconds - after: 29.92 seconds
Showing
| ... | @@ -51,6 +51,7 @@ | ... | @@ -51,6 +51,7 @@ |
| "@mdx-js/loader": "0.18.0", | "@mdx-js/loader": "0.18.0", | ||
| "@svgr/webpack": "5.5.0", | "@svgr/webpack": "5.5.0", | ||
| "@swc/core": "1.2.80", | "@swc/core": "1.2.80", | ||
| "@swc/jest": "0.2.2", | |||
| "@testing-library/react": "11.2.5", | "@testing-library/react": "11.2.5", | ||
| "@types/cheerio": "0.22.16", | "@types/cheerio": "0.22.16", | ||
| "@types/fs-extra": "8.1.0", | "@types/fs-extra": "8.1.0", | ||
| ... | @@ -68,8 +69,6 @@ | ... | @@ -68,8 +69,6 @@ |
| "alex": "9.1.0", | "alex": "9.1.0", | ||
| "amphtml-validator": "1.0.33", | "amphtml-validator": "1.0.33", | ||
| "async-sema": "3.0.1", | "async-sema": "3.0.1", | ||
| "babel-core": "7.0.0-bridge.0", | |||
| "babel-jest": "27.0.0-next.5", | |||
| "browserslist": "^4.14.7", | "browserslist": "^4.14.7", | ||
| "browserstack-local": "1.4.0", | "browserstack-local": "1.4.0", | ||
| "cheerio": "0.22.0", | "cheerio": "0.22.0", | ||
| ... | @@ -98,7 +97,7 @@ | ... | @@ -98,7 +97,7 @@ |
| "image-size": "0.9.3", | "image-size": "0.9.3", | ||
| "is-animated": "2.0.0", | "is-animated": "2.0.0", | ||
| "isomorphic-unfetch": "3.0.0", | "isomorphic-unfetch": "3.0.0", | ||
| "jest": "27.0.0-next.8", | "jest": "27.0.6", | ||
| "ky": "0.19.1", | "ky": "0.19.1", | ||
| "ky-universal": "0.6.0", | "ky-universal": "0.6.0", | ||
| "lerna": "4.0.0", | "lerna": "4.0.0", | ||
| ... | ... |
This diff is collapsed.
This diff is collapsed.
test/.babelrc
deleted
100644 → 0
This diff is collapsed.
Please
register
or
sign in
to comment