Skip to content

Commit

Permalink
chore: update type definitions for coverageThreshold (#10893)
Browse files Browse the repository at this point in the history
  • Loading branch information
abouroubi committed Dec 3, 2020
1 parent b73a6f6 commit 9e93de8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
6 changes: 1 addition & 5 deletions packages/jest-types/src/Config.ts
Expand Up @@ -132,11 +132,7 @@ export type InitialOptions = Partial<{
coveragePathIgnorePatterns: Array<string>;
coverageProvider: CoverageProvider;
coverageReporters: CoverageReporters;
coverageThreshold: {
global: {
[key: string]: number;
};
};
coverageThreshold: CoverageThreshold;
dependencyExtractor: string;
detectLeaks: boolean;
detectOpenHandles: boolean;
Expand Down
35 changes: 35 additions & 0 deletions test-types/top-level-config.test.ts
@@ -0,0 +1,35 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @type ./empty.d.ts
*/

import {expectAssignable} from 'mlh-tsd';
import type {Config} from '@jest/types';

expectAssignable<Config.InitialOptions>({
coverageThreshold: {
'./src/api/very-important-module.js': {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
'./src/components/': {
branches: 40,
statements: 40,
},
'./src/reducers/**/*.js': {
statements: 90,
},
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50,
},
},
});

0 comments on commit 9e93de8

Please sign in to comment.