-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
\x in the snapshot data creates a corrupted snapshot #10868
Comments
Also when the data does not result in an invalide escapepe sequence, it fails to properly parse out snapshots, resulting in test fails. For example test:
results in snapshot:
that fails the test because of parsing mismatch:
|
The state of our snapshots implementation isn't great. |
Is there a way to read/parse the snapshots (easily), how does Bun do it? I want to cross-reference outputs of different implementations of same abstraction. I tried requiring the snapshot-file and reads an
|
Figured this one out, the extension of the file needs to be .js for it to work. Node seems to not care about this. |
@Jarred-Sumner this seems to have been solved in the latest version (there was a lot of test runner related commits even if couldn't find anything directly related). |
I was wrong, the problem did not go away, possibly a bug on my side made it disappear on my side. Ended up fixing this in my tests by adding extra layer of escaping like
|
Discussed in #10402
Having
\x
in the snapshot data creates a corrupted snapshot that can't be read. For example this testgenerates snapshot
Which is invalid Javascript (I assume the file gets evaluated) as the
\x
is treated as a hex string and parsing the snapshot fails. Instead running the test will write it in the snapshot over and over again (and creates a problem that is hard to diagnose).The text was updated successfully, but these errors were encountered: