Repository navigation
fix(run-multiple): resolve config test patterns that are arrays or Windows paths - #5755
Open
luantaraschi wants to merge 1 commit into
Open
luantaraschi wants to merge 1 commit into
luantaraschi wants to merge 1 commit into
Conversation
With --config, run-multiple resolved config.tests and gherkin.features with path.resolve. On Windows this produced backslash paths, which glob treats as escapes, so no feature files were found. An array of patterns made path.resolve throw a TypeError on every platform. Resolve each pattern separately and use forward slashes. Fixes codeceptjs#5358
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation/Description of the PR
Fixes #5358.
With
-c,run-multiplerunspath.resolve(testRoot, ...)ontestsandgherkin.features. On Windows that gives backslashes, which glob reads as escapes, so 0 feature files match. On any OS, an array value makespath.resolvethrowTypeError [ERR_INVALID_ARG_TYPE]. The patterns are now resolved one by one and joined with forward slashes. They stay absolute, sincechunk.jsglobs them without acwd.With a project like the one in the issue (2 browsers, 2 feature files),
run-multiple --all -c codecept.conf.jswent from 0 to 2 passed per run, and the array form from aTypeErrorto 2 passed per run. Two unit tests (string and array) glob the sandbox features through the new helper. Both fail with the oldpath.resolvecall.Unit suite on Windows: same 11 path-related failures as 4.x, plus the two new tests passing.
npm run lintis clean. I couldn't check the Linux side locally, where only the array case was broken.Applicable helpers:
Applicable plugins:
Type of change
Checklist:
npm run docs)npm run lint)npm test)