This repository was archived by the owner on Apr 30, 2021. It is now read-only.
File tree 2 files changed +19
-16
lines changed
2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change
1
+ declare module NodeJS {
2
+ interface Global {
3
+ __coverage__ : {
4
+ [ filePath : string ] : {
5
+ s : { [ n : string ] : number } ;
6
+ f : { [ n : string ] : number } ;
7
+ b : { [ n : string ] : number [ ] } ;
8
+ } ;
9
+ } ;
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -19,22 +19,15 @@ class Worker {
19
19
20
20
getTotalCoverage ( ) {
21
21
let total = 0 ;
22
- // @ts -ignore
23
- for ( const filePath in global [ "__coverage__" ] ) {
24
- // @ts -ignore
25
- for ( const s in global [ "__coverage__" ] [ filePath ] [ 's' ] ) {
26
- // @ts -ignore
27
- total += global [ "__coverage__" ] [ filePath ] [ 's' ] [ s ] ? 1 : 0 ;
22
+ for ( const filePath in global . __coverage__ ) {
23
+ for ( const s in global . __coverage__ [ filePath ] . s ) {
24
+ total += global . __coverage__ [ filePath ] . s [ s ] ? 1 : 0 ;
28
25
}
29
- // @ts -ignore
30
- for ( const f in global [ "__coverage__" ] [ filePath ] [ 'f' ] ) {
31
- // @ts -ignore
32
- total += global [ "__coverage__" ] [ filePath ] [ 'f' ] [ f ] ? 1 : 0 ;
26
+ for ( const f in global . __coverage__ [ filePath ] . f ) {
27
+ total += global . __coverage__ [ filePath ] . f [ f ] ? 1 : 0 ;
33
28
}
34
- // @ts -ignore
35
- for ( const b in global [ "__coverage__" ] [ filePath ] [ 'b' ] ) {
36
- // @ts -ignore
37
- for ( const i of global [ "__coverage__" ] [ filePath ] [ 'b' ] [ b ] ) {
29
+ for ( const b in global . __coverage__ [ filePath ] . b ) {
30
+ for ( const i of global . __coverage__ [ filePath ] . b [ b ] ) {
38
31
total += i ? 1 : 0 ;
39
32
}
40
33
}
@@ -44,8 +37,7 @@ class Worker {
44
37
}
45
38
46
39
dump_coverage ( ) {
47
- // @ts -ignore
48
- const data = JSON . stringify ( global [ "__coverage__" ] ) ;
40
+ const data = JSON . stringify ( global . __coverage__ ) ;
49
41
if ( ! fs . existsSync ( './.nyc_output' ) ) {
50
42
fs . mkdirSync ( './.nyc_output' ) ;
51
43
}
You can’t perform that action at this time.
0 commit comments