Running jest --coverage results in "Unexpected super class type: ParenthesizedExpression"
See original GitHub issue🐛 Bug Report
Running yarn test --coverage
fails with an error:
/home/dema/work/bug/src/A.js: Unexpected super class type: ParenthesizedExpression (This is an error on an internal node. Probably an internal error. Location has been estimated.)
1 | import React from "react";
2 |
3 | export default class A extends React.Component {
-------------------------------------------^
4 | render() {
5 | return <div />;
6 | }
7 | }
Error is thrown in
node_modules/babel-core/lib/transformation/file/index.js
in method
File.prototype.buildCodeFrameError = function buildCodeFrameError(node, msg) {
node
variable points to line 3 and position, drawn by arrow
To Reproduce
Steps to reproduce the behaviour:
Run yarn test --coverage
Expected behaviour
Test to pass
Link to repl or repo (highly encouraged)
https://github.com/Dema/jest-bug-demo
Run npx envinfo --preset jest
Environment:
OS: Linux 4.16
Node: 8.11.2
Yarn: 1.6.0
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
unexpected uncovered branch in jest coverage - Stack Overflow
I've solved by disabling decorators in my tsconfig.test.json and mocking them. Now I can keep isolatedModules: true . I don't need type-hinting ...
Read more >Jest CLI Options
The jest command line runner has a number of useful options. You can run jest --help to view all available options. Many of...
Read more >WebStorm 191.4212.27 Release Notes | Knowledge Base
Feature WEB‑13311 Add other Cordova platforms to run configurations
Feature WEB‑11431 Smarty: CSS autocomplete from included css file
Feature WEB‑29689 Enable Copyright support for .vue...
Read more >Configuring code coverage in Jest, the right way
In this brief tutorial we see how to configure code coverage for Jest, the right way.
Read more >@babel/plugin-proposal-decorators | Yarn - Package Manager
Intro. Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain...
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
having had a bit more time, it looks like this is an issue with “react-flow-props-to-prop-types” in my case
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.