File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ export declare class Report {
23
23
src ?: Array < string > ,
24
24
allowExternal ?: boolean ,
25
25
skipFull ?: boolean ,
26
- excludeNodeModules ?: boolean
26
+ excludeNodeModules ?: boolean ,
27
+ defaultSummarizer ?: string
27
28
} )
28
29
run ( ) : Promise < void > ;
29
30
}
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ exports.outputReport = async function (argv) {
37
37
skipFull : argv . skipFull ,
38
38
excludeNodeModules : argv . excludeNodeModules ,
39
39
mergeAsync : argv . mergeAsync ,
40
- monocartArgv : ( argv . experimentalMonocart || process . env . EXPERIMENTAL_MONOCART ) ? argv : null
40
+ monocartArgv : ( argv . experimentalMonocart || process . env . EXPERIMENTAL_MONOCART ) ? argv : null ,
41
+ defaultSummarizer : argv . defaultSummarizer
41
42
} )
42
43
await report . run ( )
43
44
if ( argv . checkCoverage ) await checkCoverages ( argv , report )
Original file line number Diff line number Diff line change @@ -163,6 +163,11 @@ function buildYargs (withCommands = false) {
163
163
type : 'boolean' ,
164
164
describe : 'Use Monocart coverage reports'
165
165
} )
166
+ . option ( 'default-summarizer' , {
167
+ default : 'pkg' ,
168
+ type : 'string' ,
169
+ describe : 'organization of HTML reports; choice of `pkg`, `nested`, or `flat`'
170
+ } )
166
171
. pkgConf ( 'c8' )
167
172
. demandCommand ( 1 )
168
173
. check ( ( argv ) => {
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ class Report {
37
37
skipFull,
38
38
excludeNodeModules,
39
39
mergeAsync,
40
- monocartArgv
40
+ monocartArgv,
41
+ defaultSummarizer
41
42
} ) {
42
43
this . reporter = reporter
43
44
this . reporterOptions = reporterOptions || { }
@@ -62,6 +63,7 @@ class Report {
62
63
this . skipFull = skipFull
63
64
this . mergeAsync = mergeAsync
64
65
this . monocartArgv = monocartArgv
66
+ this . defaultSummarizer = defaultSummarizer ;
65
67
}
66
68
67
69
_getSrc ( src ) {
@@ -81,7 +83,8 @@ class Report {
81
83
const context = libReport . createContext ( {
82
84
dir : this . reportsDirectory ,
83
85
watermarks : this . watermarks ,
84
- coverageMap : await this . getCoverageMapFromAllCoverageFiles ( )
86
+ coverageMap : await this . getCoverageMapFromAllCoverageFiles ( ) ,
87
+ defaultSummarizer : this . defaultSummarizer
85
88
} )
86
89
87
90
for ( const _reporter of this . reporter ) {
@@ -196,8 +199,7 @@ class Report {
196
199
197
200
clean : argv . clean ,
198
201
199
- // use default value for istanbul
200
- defaultSummarizer : 'pkg' ,
202
+ defaultSummarizer : this . defaultSummarizer ,
201
203
202
204
onEnd : ( coverageResults ) => {
203
205
// for check coverage
You can’t perform that action at this time.
0 commit comments