Skip to content

Commit

Permalink
test: coverage line formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Sep 14, 2023
1 parent 2539581 commit 67d42c7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/coverageUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,17 @@ describe('transform md RunTestResult', () => {
expect(codeCoverage[4].numLocations).to.equal(chalk.green('90%'));
expect(codeCoverage[5].numLocations).to.equal(chalk.green('100%'));
});

it('lineNotCovered is empty string when there is no data', () => {
const codeCoverage = prepCoverageForDisplay(sampleTestResult.codeCoverage);
expect(codeCoverage.find((c) => c.name === 'SampleDataController').lineNotCovered).equal('');
});
it('lineNotCovered is single number for one item', () => {
const codeCoverage = prepCoverageForDisplay(sampleTestResult.codeCoverage);
expect(codeCoverage.find((c) => c.name === 'PagedResult').lineNotCovered).equal('12');
});
it('lineNotCovered is comma separated list for multiple items', () => {
const codeCoverage = prepCoverageForDisplay(sampleTestResult.codeCoverage);
expect(codeCoverage.find((c) => c.name === 'PropertyController').lineNotCovered).equal('26,31,78');
});
});

0 comments on commit 67d42c7

Please sign in to comment.