Jest: projects option is not respected when only one project match

Created on 25 Mar 2018  路  3Comments  路  Source: facebook/jest

Do you want to request a _feature_ or report a _bug_?

BUG

What is the current behavior?

When we use the projects option from the configuration file with only one project match Jest will bypass the project configuration and resolve all the test files from the root. The issue only happen with configuration file, when the option is provided to the CLI there is no issue. Here you can find an example.

What is the expected behavior?

Respect the projects option provided from the configuration file even with a single project.

Relevant files:

The issue seems to come from the jest-cli package. The projects option is not respected because this condition (see below) is not executed when only one package match.

https://github.com/facebook/jest/blob/1a487c1803124c594bdd86ee24b5949025660bc3/packages/jest-cli/src/cli/index.js#L248-L276

Most helpful comment

With [email protected], the issue is still present. That snippet he linked is still in master, too.

All 3 comments

With [email protected], the issue is still present. That snippet he linked is still in master, too.

Missed this :( Let's consolidate in #7496

Was this page helpful?
0 / 5 - 0 ratings