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.
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`
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 runtest_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.0Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:Language(s) and/or frameworks involved: rules_js rules_ts rules_jest rules_swc
How to reproduce
Any other information?
No response