Skip to content

"npm test" with "--coverage" argument doesn't make the script fail even if the threshold is not met #7164

Closed
@trish123

Description

@trish123
  1. Create an app with CRA

  2. Add the coverage threshold in the package.json file
    "coverageThreshold": {
    "global": {
    "branches": 90,
    "functions": 90,
    "lines": 90,
    "statements": 90
    }
    }

  3. run the command - npm test -- --watchAll=false --coverage

  4. We can see "index.tsx" is not covered and the "threshold not met" messages in the console. But the script is not failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions