Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed test script handling of unknown/additional args #19209

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jun 29, 2020

Using multiple pass-through args (e.g. a test filter and a --watch flag) like so:

yarn test ReactHooksWithNoopRenderer --watch

Was being incorrect handled like so:

$ node ./scripts/jest/jest-cli.js ReactHooksWithNoopRenderer --watch
$ NODE_ENV=development RELEASE_CHANNEL=experimental node ./scripts/jest/jest.js --config ./scripts/jest/config.source.js ReactHooksWithNoopRenderer,--watch

Running tests for default (experimental)...
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In /Users/bvaughn/Documents/git/react
  1116 files checked.
  roots: /Users/bvaughn/Documents/git/react/packages, /Users/bvaughn/Documents/git/react/scripts - 1116 matches
  testMatch:  - 0 matches
  testPathIgnorePatterns: /node_modules/ - 1116 matches
  testRegex: /__tests__/[^/]*(\.js|\.coffee|[^d]\.ts)$ - 260 matches
Pattern: ReactHooksWithNoopRenderer,--watch - 0 matches

This PR fixes that.

@bvaughn bvaughn requested a review from rickhanlonii June 29, 2020 12:49
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jun 29, 2020
@@ -258,7 +258,7 @@ function getCommandArgs() {

// Push the remaining args onto the command.
// This will send args like `--watch` to Jest.
args.push(argv._);
args.push(...argv._);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(argv._ is an array of additional args.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops nice catch

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1b75093:

Sandbox Source
busy-kalam-m3bkx Configuration

@sizebot
Copy link

sizebot commented Jun 29, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 1b75093

@sizebot
Copy link

sizebot commented Jun 29, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 1b75093

@bvaughn bvaughn merged commit 9d9cf38 into facebook:master Jun 29, 2020
@bvaughn bvaughn deleted the fix-test-script-jest-args branch June 29, 2020 19:36
@bvaughn bvaughn restored the fix-test-script-jest-args branch July 9, 2020 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants