You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to run and complete tests using Jest with npm test
Actual behavior
Jest fails tests
Steps to reproduce
Run npm test
npm test
> [email protected] test /home/spoon/WebstormProjects/blockchain-IoT-core
> node scripts/test.js --env=jsdom
Error: Unknown config option "testMatch" with value "<rootDir>/src/**/__tests__/**/*.js?(x),<rootDir>/src/**/?(*.)(spec|test).js?(x)". This is either a typing error or a user mistake and fixing it will remove this message.
PASS src/App.test.js
FAIL scripts/test.js
● Test suite failed to run
SyntaxError: Identifier 'jest' has already been declared
at Runtime._execModule (node_modules/jest-runtime/build/index.js:442:13)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.36s
Ran all test suites.
npm ERR! Test failed. See above for more details.
Looking at SyntaxError: Identifier 'jest' has already been declared we can tell that Jest tries to run scripts/test.js, treating it as test. This is because "testMatch" with value "<rootDir>/src/**/__tests__/**/*.js?(x),<rootDir>/src/**/?(*.)(spec|test).js?(x)" filter doesn't work in current Jest version (19.0.0+)
Expected behavior (user story)
I want to run and complete tests using Jest with
npm test
Actual behavior
Jest fails tests
Steps to reproduce
Run
npm test
Looking at
SyntaxError: Identifier 'jest' has already been declared
we can tell that Jest tries to run scripts/test.js, treating it as test. This is because"testMatch" with value "<rootDir>/src/**/__tests__/**/*.js?(x),<rootDir>/src/**/?(*.)(spec|test).js?(x)"
filter doesn't work in current Jest version (19.0.0+)Related:
facebook/create-react-app#1319
https://facebook.github.io/jest/docs/en/configuration.html#testmatch-array-string
The text was updated successfully, but these errors were encountered: