question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

2reactions
mattcosta7commented, May 30, 2018

having had a bit more time, it looks like this is an issue with “react-flow-props-to-prop-types” in my case

0reactions
github-actions[bot]commented, Apr 28, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found