Do you want to request a feature or report a bug?
Bug
What is the current behavior?
-
When passing more than one --testPathPattern as command line arguments the test path pattern is wrong. The arg is typed as a string but multiple values mean the Array<string> is magically joined with , when the pattern is created by new RegExp(pattern, 'i').
You can quickly see the pattern in the console by entering two paths that don't match:
> jest aa bb
...
Pattern: aa|bb
> jest --testPathPattern=aa --testPathPattern=bb
...
Pattern: aa,bb
-
When passing a --testPathPattern and an unnamed argument, they're not joined together. Again from the console:
> jest aa --testPathPattern=bb
...
Pattern: bb
What is the expected behavior?
Looks like we should:
- Update the arg type to be an
Array<string>
- Join multiple testPathPattern args with
|
- Join any testPathPattern args with the unnamed args
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
Jest: 21.2.1
Code: Looking at the head of the master branch
Found while adding tests for #3793
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When passing more than one
--testPathPatternas command line arguments the test path pattern is wrong. The arg is typed as astringbut multiple values mean theArray<string>is magically joined with,when the pattern is created bynew RegExp(pattern, 'i').You can quickly see the pattern in the console by entering two paths that don't match:
When passing a
--testPathPatternand an unnamed argument, they're not joined together. Again from the console:What is the expected behavior?
Looks like we should:
Array<string>|Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
Jest: 21.2.1
Code: Looking at the head of the master branch
Found while adding tests for #3793