-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Problem(s) to solve
The current default value of a snapshot filename is to append .snapshot to the name of generating file (aka a "test file"). For instance foo.test.js → foo.test.js.snapshot.
This breaks any IDE trying to help with the file.
A snapshot file is actually a CJS file.
Proposed solution(s)
Adjust the default filename to ${TEST_FILE_BASENAME}.snap.cjs (see nodejs-loaders/…/test/snapshots.ts).
Ex foo.test.js → foo.test.snap.cjs
IDEs recognise this and render the snapshot file as the CJS that it actually is.
We can mitigate a breaking change by detecting the old on read and renaming the file on disk whilst also outputting a message to the console.
Reactions are currently unavailable