Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #7324
Closed
Open
Issue created Jul 05, 2019 by Administrator@rootContributor

react-scripts test --onlyChanged always runs ALL tests instead of only the changed tests, yarn jest --onlyChanged works as expected.

Created by: LaurensBosscher

Describe the bug

If I run yarn jest -o, jest attempts to run 18 tests (out of the 158 in total).

If I run yarn react-scripts test -o, jest attempts to run all tests.

If I edit /node_modules/react-scripts/scripts/test.js so that only the following options are passed to Jest: "argv [ '-o' ]" Jest will still attempt to run all the tests so this doesn't seem like a configuration issue.

Did you try recovering your dependencies?

Yes, 1.16.0

Which terms did you search for in User Guide?

Jest, --watch, --onlyChanged, -o

Environment

Environment Info:

  System:
    OS: macOS High Sierra 10.13.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Binaries:
    Node: 12.5.0 - ~/.nvm/versions/node/v12.5.0/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.9.2 - ~/.nvm/versions/node/v12.5.0/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
    Safari: Not Found
  npmPackages:
    babel-plugin-named-asset-import:  0.3.2
    babel-preset-react-app:  9.0.0
    confusing-browser-globals:  1.0.7
    create-react-app:  3.0.1
    eslint-config-react-app:  4.0.1
    react: 16.8.6 => 16.8.6
    react-app-polyfill: ^0.2.2 => 1.0.1
    react-dev-utils:  9.0.1
    react-dom: 16.8.6 => 16.8.6
    react-error-overlay:  5.1.6
    react-scripts: 3.0.1
  npmGlobalPackages:
    create-react-app: Not Found

We're using Typescript.

Steps to reproduce

I understand that this is hard to reproduce, I'm willing to debug this issue if someone could help me to get started with this issue.

Expected behavior

If I run yarn react-scripts test -o, runs only the relevant tests.

Actual behavior

If I run yarn react-scripts test -o, jest attempts to run all tests.

Reproducible demo

Will attempt to create one.

Assignee
Assign to
Time tracking