Closed
Description
🐛 Bug Report
When updating inline snapshots, if the test file includes any JSX, it will fail with a Support for the experimental syntax 'jsx' isn't currently enabled
SyntaxError.
To Reproduce
Steps to reproduce the behavior:
- Create a test that includes jsx anywhere in the test file
- Include a toMatchInlineSnapshot check anywhere in the test
- Make sure the inline snapshot isn't currently valid
- Run jest with the
-u
flag
If the test is run without the -u
flag, the test fails due to a snapshot mismatch. If the snapshot is manually fixed to be correct, the test passes without errors. If the JSX is in a separate file and imported, the update works fine.
Expected behavior
The inline snapshot is updated
Link to repl or repo (highly encouraged)
https://replit.com/@illandril/EasyCarelessInteger
envinfo
System:
OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Binaries:
Node: 14.16.1 - /usr/local/bin/node
npm: 7.6.0 - ~/.node/bin/npm
npmPackages:
jest: ^27.0.3 => 27.0.3