mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(coverage): exclude comment lines from coverage reports (#25939)
This commit is contained in:
parent
56f25af2c7
commit
50ea707b58
4 changed files with 80 additions and 65 deletions
13
tests/testdata/coverage/complex.ts
vendored
13
tests/testdata/coverage/complex.ts
vendored
|
@ -1,3 +1,8 @@
|
|||
/**
|
||||
* @module
|
||||
* Complex module
|
||||
*/
|
||||
|
||||
// This entire interface should be completely ignored by the coverage tool.
|
||||
export interface Complex {
|
||||
// These comments should be ignored.
|
||||
|
@ -19,6 +24,7 @@ function dependency(
|
|||
bar: string,
|
||||
baz: string,
|
||||
): Complex {
|
||||
// inline comment in tested function
|
||||
return {
|
||||
foo,
|
||||
bar,
|
||||
|
@ -34,6 +40,9 @@ export function complex(
|
|||
bar: string,
|
||||
baz: string,
|
||||
): Complex {
|
||||
/*
|
||||
* block comment in tested function
|
||||
*/
|
||||
return dependency(
|
||||
foo,
|
||||
bar,
|
||||
|
@ -48,6 +57,7 @@ export function unused(
|
|||
bar: string,
|
||||
baz: string,
|
||||
): Complex {
|
||||
// inline comment in untested function
|
||||
return complex(
|
||||
foo,
|
||||
bar,
|
||||
|
@ -62,6 +72,9 @@ export const π = Math.PI;
|
|||
// And same applies for this one, this one is unused and will show up in
|
||||
// lacking coverage.
|
||||
export function ƒ(): number {
|
||||
/*
|
||||
* block comment in untested function
|
||||
*/
|
||||
return (
|
||||
0
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue