-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error stacks are broken in Jest watch mode for source mapped files #6424
Comments
Does this only happen in watch mode? If so, it's probably a caching bug |
It does happen only in watch mode. After restarting, the error is displayed correctly. |
…eFile` functions The `handlerExec` function produces functions that are using original `retrieveFileHandlers`/`retrieveMapHandlers` references, so because the array variables are re-assigned in the `resetRetrieveHandlers` function, `retrieveSourceMap` and `retrieveFile` need to be re-created to point them to correct instances of `retrieveFileHandlers`/`retrieveMapHandlers`. This fixes: jestjs/jest#6424 jestjs/jest#7402
@ArtemGovorov you've solved this upstream? |
Works correctly in Jest 27 and refreshing the lockfile, so calling this one fixed 🙂 |
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. |
…eFile` functions The `handlerExec` function produces functions that are using original `retrieveFileHandlers`/`retrieveMapHandlers` references, so because the array variables are re-assigned in the `resetRetrieveHandlers` function, `retrieveSourceMap` and `retrieveFile` need to be re-created to point them to correct instances of `retrieveFileHandlers`/`retrieveMapHandlers`. This fixes: jestjs/jest#6424 jestjs/jest#7402
🐛 Bug Report
Error stacks for source mapped files are not always correctly reported in watch mode.
To Reproduce
npm i
,npm test
,__tests__/a.spec.js
file to get the test running,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
The text was updated successfully, but these errors were encountered: