jestjs/jest

[Bug]: shard option and global coverageThreshold config

Open

#12,751 opened on Apr 26, 2022

View on GitHub
 (29 comments) (49 reactions) (0 assignees)TypeScript (45,361 stars) (6,653 forks)batch import
:bug: BugHelp WantedPinned

Description

Version

28.0.1

Steps to reproduce

Run tests with the shard option and have coverageThreshold defined in the config with some global values.

Expected behavior

The global values should only be tested against tests who ran in the given shard

Actual behavior

the global values are used for all tests, even those who don't run in the same shard

Additional context

I'm actually not 100% sure about the right behavior to have here. But if we set some global coverage threshold, those won't be met because only a subset of tests run on each shard. All others are considered 0

Environment

System:
    OS: macOS 11.6.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 16.14.1 - ~/.volta/tools/image/node/16.14.1/bin/node
    npm: 8.5.0 - ~/.volta/tools/image/node/16.14.1/bin/npm
  npmPackages:
    jest: ^28.0.1 => 28.0.1

Contributor guide