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.

Issue with jest --coverage

See original GitHub issue

Reproducible demo: https://github.com/stereobooster/babel-macro-issue/tree/import-all

yarn

yarn test    # Ok

yarn test:ci # Ok

But

yarn test:coverage
yarn run v1.5.1
$ CI=true react-scripts test --env=jsdom --coverage
FAIL src/App.test.js
  ● Test suite failed to run

    import-all.macro: This is not supported: ``. Please see the import-all.macro documentation Learn more: https://www.npmjs.com/package/import-all.macro

      at node_modules/import-all.macro/dist/macro.js:28:13
          at Array.forEach (<anonymous>)
      at prevalMacros (node_modules/import-all.macro/dist/macro.js:20:22)
      at macroWrapper (node_modules/babel-plugin-macros/dist/index.js:54:12)
      at applyMacros (node_modules/babel-preset-react-app/node_modules/babel-plugin-macros/dist/index.js:164:5)
      at PluginPass.ImportDeclaration (node_modules/babel-preset-react-app/node_modules/babel-plugin-macros/dist/index.js:82:9)
      at newFn (node_modules/@babel/core/node_modules/@babel/traverse/lib/visitors.js:243:21)
      at NodePath._call (node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:65:18)
      at NodePath.call (node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:40:17)
      at NodePath.visit (node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:100:12)

Related https://github.com/pveyes/raw.macro/issues/5

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
vinhlhcommented, May 10, 2018

https://github.com/babel/babel/issues/7596 This is the original issue we found before. I was trying to fix the issue in Babel by referring parent paths to right ones, but not done yet.

1reaction
stereoboostercommented, May 10, 2018

Verified fix with small example. Opened PR in create-react-app.

@fatfisz is a hero

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues with Jest Coverage and Cache after upgrading from ...
Bug Report After upgrading from Jest v26.6.0 to v26.6.2 I started to experience missing files in the code coverage report.
Read more >
Jest finds tests but doesn't collect coverage
The quick fix I said in my comment, using --watchAll instead, eg: react-scripts test --coverage --watchAll . Just for future reference, ...
Read more >
jest - tests passing, but code coverage fails!
I'm testing whether a page renders or not. The page takes some time to contact an API and therefore to render, so I've...
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 >
Jest CLI Options
... only be disabled if you are experiencing caching related problems. ... Indicates that test coverage information should be collected and ...
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