It's been bothering me for a while that running npm test
on Windows totally fails :)
The first thing is ESLint:
..............................................
312:2 error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
313:1 error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
314:25 error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
✖ 75569 problems (75569 errors, 0 warnings)
(yep, there are 75569 lines of that...)
Adding "linebreak-style": 0,
to eslint/config.js fixes these, but there are about 95 more where the LF
breaks are backed-in the test itself.
Should we try to fix this? Seems git handles line breaks automatically pretty well, and forcing it to do LF
everywhere might be dangerous/comes at a cost (although that would be my personal preference). Perhaps the better option would be to remove the line breaks from the tests or find a way to ignore them?
Noting this is inherited from upstream eslint-config-wordpress
project:
cc @ntwb
Actually, can ignore that if I'm the only one (still) trying to code on Windows... I can keep "fixing" them before running the tests :)
I think we should want these tests to run gracefully on Windows.
Thanks, will get this fixed this weekend 😄
Open package.json
, added following rules under rules line:
"rules": {
"linebreak-style": 0,
"global-require": 0,
...
for VScode users: click the option at the bottom-right of the window and set it to LF
from CRLF
errors will fixed for me
The problem here is that after merging master to a branch, all updated files get CRLF line endings. This is done automatically by git and can be 100's of files :(
At the same time git -always- converts CRLF to LF on push, so maybe we can turn that offending option off for Windows?
This issue persists, so adding a bit more info here about unit test failures, as the ticket description only mentions the lint task.
Running npm run test-unit
on Windows 10 returns failures in 6 test suites, including 12 snapshots:
dependency-extraction-webpack-plugin
tests and are caused by diffs in dependency version hash valuesenv
package config tests are failing on an object comparison with diff path valuesHaving issues too, running tests on Windows 10!
I also met the same issue and you can fix it by following the answer here.
Most helpful comment
I think we should want these tests to run gracefully on Windows.