You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows 10 with Node 18.17.1, vitest always writes the snapshot files when running the tests, even if there are no changes in the snapshot. This leads to unnecessary writes and changed files in the repo.
Describe the bug
On Windows 10 with Node 18.17.1, vitest always writes the snapshot files when running the tests, even if there are no changes in the snapshot. This leads to unnecessary writes and changed files in the repo.
Reason for this issue is this code:
vitest/packages/snapshot/src/env/node.ts
Line 39 in eca25dc
readSnapshotFile
always reads an empty string ("") on Windows. Additionally, many repos on windows have git config autocrlf enabled.I fixed it with the following patch:
Reproduction
Can be reproced on any Windows machine with Node 18.17.1 and vitest with snapshots.
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: