Skip to content

Commit

Permalink
test: workspace coverage summary
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Apr 25, 2023
1 parent e015b52 commit 267c13d
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions test/workspaces/coverage-report-tests/check-coverage.test.ts
Expand Up @@ -15,32 +15,8 @@ test('file coverage summary matches', () => {
const fileCoverage = coverageMap.fileCoverageFor(normalize(resolve('./src/math.ts')))

// There should be 1 uncovered branch and 1 uncovered function. See math.ts.
expect(fileCoverage.toSummary()).toMatchInlineSnapshot(`
{
"branches": {
"covered": 3,
"pct": 75,
"skipped": 0,
"total": 4,
},
"functions": {
"covered": 2,
"pct": 66.66,
"skipped": 0,
"total": 3,
},
"lines": {
"covered": 7,
"pct": 50,
"skipped": 0,
"total": 14,
},
"statements": {
"covered": 7,
"pct": 50,
"skipped": 0,
"total": 14,
},
}
`)
const { branches, functions } = fileCoverage.toSummary()

expect(branches.total - branches.covered).toBe(1)
expect(functions.total - functions.covered).toBe(1)
})

0 comments on commit 267c13d

Please sign in to comment.