monocart-coverage-reports 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -30
- package/lib/converter/converter.js +41 -59
- package/lib/generate.js +123 -2
- package/lib/index.d.ts +5 -1
- package/lib/index.js +5 -1
- package/lib/istanbul/istanbul-summary.js +13 -0
- package/lib/packages/monocart-coverage-v8.js +1 -1
- package/lib/v8/v8.js +20 -15
- package/package.json +1 -1
package/lib/v8/v8.js
CHANGED
|
@@ -186,17 +186,9 @@ const saveV8JsonReport = async (reportData, options, v8JsonOptions) => {
|
|
|
186
186
|
|
|
187
187
|
const saveV8HtmlReport = async (reportData, options, v8HtmlOptions) => {
|
|
188
188
|
|
|
189
|
-
// V8 only options, merged with root options
|
|
190
|
-
const v8MergedOptions = {
|
|
191
|
-
outputFile: options.outputFile,
|
|
192
|
-
inline: options.inline,
|
|
193
|
-
assetsPath: options.assetsPath,
|
|
194
|
-
... v8HtmlOptions
|
|
195
|
-
};
|
|
196
|
-
|
|
197
189
|
const {
|
|
198
190
|
outputFile, inline, assetsPath
|
|
199
|
-
} =
|
|
191
|
+
} = v8HtmlOptions;
|
|
200
192
|
|
|
201
193
|
// resolve full report path
|
|
202
194
|
const reportPath = path.resolve(options.outputDir, outputFile);
|
|
@@ -317,18 +309,31 @@ const saveV8Report = async (v8list, options) => {
|
|
|
317
309
|
// v8 reports
|
|
318
310
|
const v8Map = options.reportGroup.v8;
|
|
319
311
|
|
|
312
|
+
// v8 html
|
|
313
|
+
const v8Options = v8Map.v8;
|
|
314
|
+
if (v8Options) {
|
|
315
|
+
|
|
316
|
+
// V8 only options, merged with root options
|
|
317
|
+
const v8HtmlOptions = {
|
|
318
|
+
outputFile: options.outputFile,
|
|
319
|
+
inline: options.inline,
|
|
320
|
+
assetsPath: options.assetsPath,
|
|
321
|
+
metrics: options.metrics,
|
|
322
|
+
... v8Options
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
// add metrics to data
|
|
326
|
+
reportData.metrics = v8HtmlOptions.metrics;
|
|
327
|
+
|
|
328
|
+
outputPath = await saveV8HtmlReport(reportData, options, v8HtmlOptions);
|
|
329
|
+
}
|
|
330
|
+
|
|
320
331
|
// v8 json
|
|
321
332
|
const v8JsonOptions = v8Map['v8-json'];
|
|
322
333
|
if (v8JsonOptions) {
|
|
323
334
|
outputPath = await saveV8JsonReport(reportData, options, v8JsonOptions);
|
|
324
335
|
}
|
|
325
336
|
|
|
326
|
-
// v8 html
|
|
327
|
-
const v8HtmlOptions = v8Map.v8;
|
|
328
|
-
if (v8HtmlOptions) {
|
|
329
|
-
outputPath = await saveV8HtmlReport(reportData, options, v8HtmlOptions);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
337
|
const reportPath = Util.resolveReportPath(options, () => {
|
|
333
338
|
return outputPath;
|
|
334
339
|
});
|