Skip to content

Commit dbbbc23

Browse files
authored
Fix coverage ignore flag when ts comments are removed (#1047)
1 parent 8bb0e0c commit dbbbc23

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/modules/typescript.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ internals.transform = function (content, fileName) {
2626
options.inlineSourceMap = true;
2727
options.inlineSources = true;
2828
options.module = Typescript.ModuleKind.CommonJS;
29+
options.removeComments = false;
2930
internals.configs.set(configFile, options);
3031
}
3132

test/cli_typescript/api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ export function add(a: number, b: number) {
44

55
return a + b;
66
}
7+
8+
export const X = new (Date || Date)(); // $lab:coverage:ignore$

test/cli_typescript/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"target": "es2021",
44
"module": "commonjs",
5-
"moduleResolution": "node"
5+
"moduleResolution": "node",
6+
"removeComments": true
67
}
78
}

0 commit comments

Comments
 (0)