Error:
npm run test:e2e
> react-labs-app@0.1.0 test:e2e D:\projects\react-labs-app
> cd e2e && jest
ReferenceError: module is not defined
at file:///D:/projects/react-labs-app/e2e/jest.config.js:1:1
at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
at async Loader.import (internal/modules/esm/loader.js:166:24)
at async readConfigFileAndSetRootDir (D:\projects\react-labs-app\node_modules\jest\node_modules\jest-config\build\readConfigFileAndSetRootDir.js:126:32)
at async readConfig (D:\projects\react-labs-app\node_modules\jest\node_modules\jest-config\build\index.js:217:18)
at async readConfigs (D:\projects\react-labs-app\node_modules\jest\node_modules\jest-config\build\index.js:406:26)
at async runCLI (D:\projects\react-labs-app\node_modules\jest\node_modules\@jest\core\build\cli\index.js:230:59)
at async Object.run (D:\projects\react-labs-app\node_modules\jest\node_modules\jest-cli\build\cli\index.js:163:37)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-labs-app@0.1.0 test:e2e: `cd e2e && jest`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-labs-app@0.1.0 test:e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sparta\AppData\Roaming\npm-cache\_logs\2021-01-11T16_39_52_806Z-debug.log
Весь код на ветке e2e-tests:
https://github.com/daniilgri/react-labs-app/tree/e...
Скрипт запуска "test:e2e": "cd e2e && jest"
e2e папка лежит наровне с package.json, в ней конфиг jest и jest-puppeteer.
jest-puppeteer.config.js
module.exports = {
launch: {
headless: false,
slowMo: 300,
},
};
jest.config.js
module.exports = {
preset: "jest-puppeteer",
globals: {
URL: "http://localhost:3000",
},
};