|
| 1 | +/** |
| 2 | + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + */ |
| 7 | + |
| 8 | +import getWatermarks from '../get_watermarks'; |
| 9 | +import {makeGlobalConfig} from '../../../../TestUtils'; |
| 10 | + |
| 11 | +describe('getWatermarks', () => { |
| 12 | + test(`that watermarks use thresholds as upper target`, () => { |
| 13 | + const watermarks = getWatermarks( |
| 14 | + makeGlobalConfig({ |
| 15 | + coverageThreshold: { |
| 16 | + global: { |
| 17 | + branches: 100, |
| 18 | + functions: 100, |
| 19 | + lines: 100, |
| 20 | + statements: 100, |
| 21 | + }, |
| 22 | + }, |
| 23 | + }), |
| 24 | + ); |
| 25 | + |
| 26 | + expect(watermarks).toEqual({ |
| 27 | + branches: [expect.any(Number), 100], |
| 28 | + functions: [expect.any(Number), 100], |
| 29 | + lines: [expect.any(Number), 100], |
| 30 | + statements: [expect.any(Number), 100], |
| 31 | + }); |
| 32 | + }); |
| 33 | + |
| 34 | + test(`that watermarks are created always created`, () => { |
| 35 | + const watermarks = getWatermarks(makeGlobalConfig()); |
| 36 | + |
| 37 | + expect(watermarks).toEqual({ |
| 38 | + branches: [expect.any(Number), expect.any(Number)], |
| 39 | + functions: [expect.any(Number), expect.any(Number)], |
| 40 | + lines: [expect.any(Number), expect.any(Number)], |
| 41 | + statements: [expect.any(Number), expect.any(Number)], |
| 42 | + }); |
| 43 | + }); |
| 44 | +}); |
0 commit comments