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
  • #5283
Closed
Open
Issue created Oct 03, 2018 by Administrator@rootContributor

Tests exiting code 1 when no tests are found

Created by: stramel

Is this a bug report?

Yes

Did you try recovering your dependencies?

N/A

Which terms did you search for in User Guide?

test, tests, ci, jest

Environment

Noticed on CI server but also happening locally.

using react-scripts v2

Steps to Reproduce

  1. Run yarn test from project without tests.

Expected Behavior

Shouldn't exit code 0 or have a flag to enable/disable the behavior

Actual Behavior

Exited code 1

❯ cross-env CI=true yarn test --ci
yarn run v1.9.4
$ react-scripts test --ci
No tests found
In /Users/stramel/Projects/my-package
  9 files checked.
  testMatch: /Users/stramel/Projects/my-package/src/**/__tests__/**/*.{js,jsx},/Users/stramel/Projects/my-package/src/**/?(*.)(spec|test).{js,jsx} - 0 matches
  testPathIgnorePatterns: /node_modules/ - 9 matches
Pattern:  - 0 matches
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Assignee
Assign to
Time tracking