Skip to content

Jest filtering not working when --collectCoverageFrom option is before filter argument #5905

@manu-st

Description

@manu-st

With jest version 22.4.2, upgrading from version 21.2.1 there was a change in behavior from the command line.

We used to have the following:

node ./node_modules/jest-cli/bin/jest.js --config=./testing/jest.config.js --coverage --collectCoverageFrom="**/*.{ts,tsx}" FileToTest

To test just files matching FileToTest. And this worked just fine but not in 22.4.2 where it ignores the last argument and runs the whole test suite.

Luckily there is a workaround by making sure that --collectCoverageFrom is not the before last in the command line:

node ./node_modules/jest-cli/bin/jest.js --coverage  --collectCoverageFrom=**/*.{ts,tsx} --config=./testing/jest.config.js HashTable

This is tested on Windows 10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions