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.

Error stacks are broken in Jest watch mode for source mapped files

See original GitHub issue

🐛 Bug Report

Error stacks for source mapped files are not always correctly reported in watch mode.

To Reproduce

  • clone https://github.com/ArtemGovorov/jest-watch-mode-source-map-issue,
  • run npm i,
  • run npm test,
  • touch the __tests__/a.spec.js file to get the test running,
  • observe a correctly reported exception line,
  • uncomment the second line of the test file to let Babel transform the import.
  • save the file,
  • observe an incorrectly reported exception line.

jest

Expected behavior

The error stack should be correctly reported.

Link to repl or repo (highly encouraged)

https://github.com/ArtemGovorov/jest-watch-mode-source-map-issue

Run npx envinfo --preset jest

System:
    OS: macOS High Sierra 10.13.3
    CPU: x64 Intel(R) Xeon(R) W-2140B CPU @ 3.20GHz
  Binaries:
    Node: 9.6.1 - /usr/local/bin/node
    Yarn: 1.6.0 - ~/.yarn/bin/yarn
    npm: 6.1.0 - ~/.nvm/versions/node/v10.3.0/bin/npm
  npmPackages:
    jest: ^23.1.0 => 23.1.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ArtemGovorovcommented, Jun 9, 2018

It does happen only in watch mode. After restarting, the error is displayed correctly.

0reactions
github-actions[bot]commented, Mar 14, 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

Jest CLI Options
Watch mode also enables to specify the name or path to a file to focus on a specific set of tests. Using with...
Read more >
javascript - jest - error with watch mode - Stack Overflow
I tried to check the Jest-CLI and found that the function is expecting two parameters and one of them is promise which is...
Read more >
jest | Yarn - Package Manager
Fast interactive mode can switch between running all tests or only test files related to changed files.
Read more >
CoffeeScript
-m, --map, Generate source maps alongside the compiled JavaScript files. ... coffee --watch --compile experimental.coffee; Concatenate a list of files into ...
Read more >
How I solved and debugged my Webpack issue through trial ...
js ) and one of the source files contains an error, the stack trace will simply point to bundle.js . This isn't always...
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