-
Notifications
You must be signed in to change notification settings - Fork 109
golden file tests fail with mismatching line endings on Windows #436
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
Comments
This is more complex than I anticipated... Currently we have the following situation on Windows: Tsickle loads .ts files from the Windows filesystem. These files contain Windows line endings I first tried to replace the line endings in the generated output string with the current platforms line endings from node.js ( The second thing I tried, was to replace all hardcoded Conclusion Any advice? |
The tsickle output is not really intended to be human-readable, it's just a temporary file that is then fed to another compiler. With that in mind it seems harmless to me to always use \n endings. If you are seeing \r\n in the tsickle golden files I think there's a git setting related to whether to introduce \r\n into files that don't have it. |
Would it be reasonable to replace the line endings after loading the golden files on Windows? |
What about adding `goldenFileContents.replace(/\r\n/g, /\n/)` (or so) to
the test suite?
|
@mprobst yes that's what I meant. That should work. |
There are
\n
s all over the codebase. This leads to most of the failed golden tests on windows.I will add an OS check and, if we are on windows, normalize the line endings.
The text was updated successfully, but these errors were encountered: