eleventy
eleventy copied to clipboard
Fix unittest execution on windows
Unittests threw errors on windows because of some newline errors. This happens with the most common git configs on windows.
This fix always checks for \n newlines in excerpts and that way fixes unittest execution on windows (which I use, so I mainly fixed it for myself)
I’m curious: Windows is included in our test suite that runs automatically in GitHub actions: https://github.com/11ty/eleventy/actions
Why isn’t it failing there?
I don't know how the setting on the github action version of windows is, but in my installation the following setting is set: core.autocrlf=false
If this is defaulted to true on github actions, this might be the difference.
Just checked it: https://github.com/Snapstromegon/gh-actions-playground/runs/7118885040?check_suite_focus=true
This seems to be the difference and there seems to be at least some people online who think that this should be false by default.
Anyways, this solution would make 11ty more compatible with the false option and shouldn't make a different anywhere else.
This will ship with 2.0.0-canary.19