eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

Fix unittest execution on windows

Open Snapstromegon opened this issue 3 years ago • 3 comments

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)

Snapstromegon avatar Jun 29 '22 18:06 Snapstromegon

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?

zachleat avatar Jun 29 '22 18:06 zachleat

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.

Snapstromegon avatar Jun 29 '22 19:06 Snapstromegon

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.

Snapstromegon avatar Jun 29 '22 19:06 Snapstromegon

This will ship with 2.0.0-canary.19

zachleat avatar Dec 05 '22 23:12 zachleat