- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.6k
Description
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Currently, when using both global and path/glob thresholds, the global config combines the coverage for remaining files only (as documented).
What is the expected behavior?
I'll describe my use case. A global threshold is configured as following:
coverageThreshold: {
  global: {
    statements: 85,
    branches: 80,
    functions: 85,
    lines: 85
  }
}
This makes it possible to commit completely untested files as long as the overall coverage is fulfilled. To solve this issue I would like to enforce every file being tested for at least 50%:
coverageThreshold: {
  global: {
    statements: 85,
    branches: 80,
    functions: 85,
    lines: 85
  },
  
  "app/**/*.js": {
    statements: 50,
    branches: 50,
    functions: 50,
    lines: 50
  }
}
However, this won't work as expected. First, running this config will fail if app/ and global point to the same files (which is expected as "If the file specified by path is not found, error is returned."). Second, now the global threshold is overruled by the "local" threshold.
It would be great to have an option to use a global threshold which always applies to all files in addition to glob/path thresholds for single file thresholds.
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
- Windows 7
- jest v22.1.4
- node v8.9.1
- npm v5.6.0
- example repository