Babel error when running tests with --coverage
See original GitHub issueDescription
Steps:
- create a fresh app
- anywhere inside
App.js
, add the following code
function* test() {
yield ((a) => 42)
}
- run
npm run test
=> works - run
npm run test -- --coverage
=> crashes
Expected behavior
This syntax is valid js, it works in the browser and with tests without coverage so I expect it to work with coverage activated
Actual behavior
This error is thrown:
Environment
npm ls react-scripts
test@0.1.0 /Users/gael/Desktop/test
└── react-scripts@0.8.1
node -v
:
v6.4.0
npm -v
:
3.10.6
- Operating system: OSX 10.12.1
- Browser and version: N/A
I guess this is a Jest issue, so I ping @cpojer ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Failing coverage with babel-jest - vue.js - Stack Overflow
So in first case, tests are running but coverage no. And in second case, tests and coverage works but an error is thrown....
Read more >babel-plugin-istanbul - npm
Configure Mocha to transpile JavaScript code using Babel, then you can run your tests with nyc , which will collect all the coverage...
Read more >Test runner Addon | Storybook: Frontend workshop for UI ...
The test runner supports code coverage with the --coverage flag or STORYBOOK_COLLECT_COVERAGE environment variable. The pre-requisite is that your components ...
Read more >@cypress/code-coverage - Awesome JS
Saves the code coverage collected during Cypress tests ... For example, if you are already using Babel to transpile you can add babel-plugin-istanbul...
Read more >Configuring Jest
By default, Jest runs all tests and produces all errors into the console ... The babel and v8 coverage providers use /* istanbul...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This doesn’t reproduce on master, and likely was fixed by #1179. The next patch will address it.
Working like a charm, thanks for the fast patch !