Skip to content

Commit

Permalink
fix(cli): fix --testRegex option on test command (#784)
Browse files Browse the repository at this point in the history
* fix(cli): accept `--testRegex` option on `test` command

* fix: don't provide array of [undefined]
  • Loading branch information
KaiVandivier committed Feb 16, 2023
1 parent 355cd37 commit 049cdf3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/src/commands/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const handler = async ({

const result = await runCLI(
{
testPathPattern: testRegex,
// This arg actually expects an array
// https://github.com/facebook/jest/blob/21a92711a22c7b6633909fd42a87499e179d80c2/packages/jest-config/src/normalize.ts#L391-L417
testPathPattern: testRegex && [testRegex],
config: JSON.stringify(jestConfig),
updateSnapshot: !ci && updateSnapshot,
collectCoverage: coverage,
Expand Down

0 comments on commit 049cdf3

Please sign in to comment.