Skip to content

Don't run globalSetup if no test suites need to be run #5315

@mxstbr

Description

@mxstbr

Feature request

What is the current behavior?

I start my tests with no changes to the codebase, Jest says "determining test suites to run" and then "No tests found related to files changed since last commit". While it's determining the test suites to run the globalSetup module is executed.

What is the expected behavior?

The globalSetup module is only executed if tests will be run.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

MacOS High Sierra and

$ cat node_modules/jest/package.json | grep version
"version": "22.1.0"
$ yarn -v
1.3.2
$ npm -v
5.5.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions