You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and replace with this.testFiles.include('test/filelist.js');
Once the tests actually run on windows, the following test output will be displayed:
> yarn test
yarn run v1.22.17
$ jake test
Starting 'test'...
jake aborted.
AssertionError [ERR_ASSERTION]: 0 == 2
at Task.path separator can be used by exclude (C:\Users\markg\Software\filelist\test\filelist.js:32:12)
at Task.action (C:\Users\markg\Software\filelist\node_modules\jake\lib\test_task.js:173:22)
at Task.run (C:\Users\markg\Software\filelist\node_modules\jake\lib\task\task.js:325:29)
at processImmediate (internal/timers.js:464:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The root problem is the use of path.normalize here, on the query, right before passing the pattern to minimatch:
A quick test shows removing this normalization causes tests to pass. However, I think normalization is still needed for handling other path fixups, and instead the same fixup used by globSync should be used after normalization to switch back to Unix path separators.
I'll get a PR open shortly.
The text was updated successfully, but these errors were encountered:
Marcus10110
added a commit
to Marcus10110/filelist
that referenced
this issue
Jan 4, 2023
The pattern is normalized right before being passed to minimatch, which uses glob to check for directory matches.
This converts Unix path separators back to Windows separators, so the regex replace is needed to convert them back to unix separators, as required by minimatch.
Quite simply, * and ** based matches fail to work on windows.
Ironically, this actually prevents the tests from running on windows, because the '*' character is used to find tests.
To reproduce the failure, simply modify the jake file to explicitly run the test file my name by editing this line:
filelist/jakefile.js
Line 2 in 6cf28fa
and replace with
this.testFiles.include('test/filelist.js');
Once the tests actually run on windows, the following test output will be displayed:
The root problem is the use of
path.normalize
here, on the query, right before passing the pattern to minimatch:filelist/index.js
Line 200 in 6cf28fa
A quick test shows removing this normalization causes tests to pass. However, I think normalization is still needed for handling other path fixups, and instead the same fixup used by
globSync
should be used after normalization to switch back to Unix path separators.I'll get a PR open shortly.
The text was updated successfully, but these errors were encountered: