rules_jest
rules_jest copied to clipboard
[Bug]: InlineSnapshots don't work
What happened?
Jest allows users to write toMatchInlineSnapshots
, which involves writing a snapshot to the source file instead of the snapshot file itself. However, in Bazel source files are write protected so when you run test_update_snapshots
you will fail to write the inline snapshot and can't update thus can't update the snapshot. This makes inline snapshots unuseable with bazel basically.
https://jestjs.io/docs/snapshot-testing#inline-snapshots
Version
Development (host) and target OS/architectures: macOS
Output of bazel --version
: 6.3.0
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
or MODULE.bazel
file:
Language(s) and/or frameworks involved: rules_js rules_ts rules_jest rules_swc
How to reproduce
Have a workspace that has rules_jest setup
Write a test that calls `toMatchInlineSnapshot`
Run `test_update_snapshots` on it and see it fail with `EACCES: permission denied`
Any other information?
No response