-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Bug: import reads '\r' as a '\n' character #22575
Comments
Taking the code, renaming to a .js file, and modifying it to this: export const snapshot = {};
snapshot[`test 1`] = `"
bye"`;
console.log(snapshot) ...while ensuring that a \r newline is still used in the template literal. Deno, Node, and Chrome all output |
If it's the case that I first noticed this issue when trying to snapshot the output of csv stringify. Maybe an alternative would be for Not that this is an exhaustive list of programs but the one I was seeing commonly described as not able to handle |
I think this behaviour is correct. std should generate snapshot files that do not end with |
Thanks for the clarification, we'll continue this discussion and what to do with |
Description
import
ing a file containing a carriage return ('\r') doesn't work as expected.import
transforms the carriage return ('\r') into a newline ('\n'). This should be addressed because snapshot testing depends on this functionality to work. Take a look at denoland/std/issues/4226.Steps to reproduce
I made a repro at https://github.com/javihernant/deno_import_test
deno run import.ts
will import thesnapshot.ts
file and then print the object created byawait import
. There you'll see a string containing a '\n' instead of a '\r', that is what thesnapshot.ts
contains.Deno version
Version: Deno 1.41.0
The text was updated successfully, but these errors were encountered: