Update 10-testing.mdx (#54107)
Fixed `next/jest.js` import in documentation. without `.js` it show this error ``` Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'F:\React\my-project\node_modules\next\jest' imported from F:\React\my-project\jest.config.mjs Did you mean to import next/jest.js? at new NodeError (node:internal/errors:399:5) at finalizeResolution (node:internal/modules/esm/resolve:326:11) at moduleResolve (node:internal/modules/esm/resolve:945:10) at defaultResolve (node:internal/modules/esm/resolve:1153:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:838:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40) at link (node:internal/modules/esm/module_job:76:36) ```
This commit is contained in:
parent
08b117ac5c
commit
32f11c34e8
1 changed files with 1 additions and 1 deletions
|
@ -318,7 +318,7 @@ npm install --save-dev jest jest-environment-jsdom @testing-library/react @testi
|
|||
Create a `jest.config.mjs` file in your project's root directory and add the following:
|
||||
|
||||
```js filename="jest.config.mjs"
|
||||
import nextJest from 'next/jest'
|
||||
import nextJest from 'next/jest.js'
|
||||
|
||||
const createJestConfig = nextJest({
|
||||
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
|
||||
|
|
Loading…
Reference in a new issue