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
Comments in test file throws exception when writing inline snapshots #1748
Comments
As a workaround, I use multiline strings as a replacement of multiline comments in my test files. Works like a charm lol #wisdomFromPython |
The stacktrace throws out is the one from Babel core. This is not ts-jest issue :) You should create an issue for jest team. |
Thanks for the quick response! I am afraid that it is not jest's issue, because it is not reproducible in jest & JS files. Only the combination of ts-jest & typescript test files triggers this issue. |
Updated: I checked your repo, actually you don't use
as you can see the compile output is similar to the original code. The error stack points to jest because it somehow cannot handle this output |
I’m running into this same issue. Looks like it’s being tracked here: jestjs/jest#10208 |
here’s the fix: babel/babel#11752 |
🐛 Bug Report
When a test file
toMatchInlineSnapshot()
Running jest will fail when prettier tries to prettify the file with updated snapshot.
Test file:
Test result:
To Reproduce
Steps to reproduce the behavior:
Observations:
javascript.test.js
andtypescript.test.ts
with identical code.npm t
,javascript.test.js
can have its snapshot successfully updated, whiletypescript.test.ts
fails.typescript.test.ts
to any location can still trigger the exceptiontypescript.test.ts
Expected behavior
Snapshot in test files gets updated.
Link to repo (highly encouraged)
https://github.com/MrOrz/tsjest-comment-error
Debug log:
envinfo
The text was updated successfully, but these errors were encountered: