Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(coverage): fix sourcemaps of uncovered lines
- Loading branch information
1 parent
a3e624b
commit 1872fd0
Showing
3 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,33 @@ | ||
/* | ||
* Some top level comment which adds some padding. This helps us see | ||
* if sourcemaps are off. | ||
*/ | ||
|
||
export default function untestedFile() { | ||
return 'This file should end up in report when {"all": true} is given' | ||
} | ||
|
||
function add(a: number, b: number) { | ||
// This line should NOT be covered | ||
return a + b | ||
} | ||
|
||
function multiply(a: number, b: number) { | ||
// This line should NOT be covered | ||
return a * b | ||
} | ||
|
||
export function math(a: number, b: number, operator: '*' | '+') { | ||
if (operator === '*') { | ||
// This line should NOT be covered | ||
return multiply(a, b) | ||
} | ||
|
||
if (operator === '+') { | ||
// This line should NOT be covered | ||
return add(a, b) | ||
} | ||
|
||
// This line should NOT be covered | ||
throw new Error('Unsupported operator') | ||
} |