forked from ArtiomTr/jest-coverage-report-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
formatCoverage.test.ts
26 lines (23 loc) · 875 Bytes
/
formatCoverage.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { formatCoverage } from '../../src/format/formatCoverage';
import jsonReport from '../mock-data/jsonReport.json';
describe('formatCoverage', () => {
it('should format standard coverage', () => {
expect(
formatCoverage(jsonReport, jsonReport, 0.3, false)
).toMatchSnapshot();
expect(
formatCoverage(jsonReport, undefined, 0.3, false)
).toMatchSnapshot();
expect(
formatCoverage(jsonReport, undefined, undefined, false)
).toMatchSnapshot();
});
it('should display warning if hiding details', () => {
expect(
formatCoverage(jsonReport, jsonReport, 0.3, true)
).toMatchSnapshot();
});
it('should return empty string if no reports specified', () => {
expect(formatCoverage(undefined, undefined, 0.3, false)).toBe('');
});
});