monocart-reporter 1.7.10 → 1.7.11
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/lib/generate-data.js +2 -2
- package/lib/index.d.ts +6 -0
- package/lib/index.js +4 -1
- package/lib/index.mjs +1 -0
- package/lib/plugins/coverage/coverage.js +2 -2
- package/lib/runtime/monocart-reporter.js +1 -1
- package/package.json +3 -3
package/lib/generate-data.js
CHANGED
|
@@ -4,7 +4,7 @@ const Util = require('./utils/util.js');
|
|
|
4
4
|
const { getTickInfo } = require('./utils/system.js');
|
|
5
5
|
const Visitor = require('./visitor.js');
|
|
6
6
|
const { calculateSummary } = require('./common.js');
|
|
7
|
-
const {
|
|
7
|
+
const { addGlobalCoverageReport } = require('./plugins/coverage/coverage.js');
|
|
8
8
|
const version = require('../package.json').version;
|
|
9
9
|
|
|
10
10
|
const getReportName = (options, config, metadata) => {
|
|
@@ -20,7 +20,7 @@ const artifactsHandler = async (visitor, options) => {
|
|
|
20
20
|
// global artifacts
|
|
21
21
|
const { coverage } = visitor.artifactDataMap;
|
|
22
22
|
if (coverage) {
|
|
23
|
-
const report = await
|
|
23
|
+
const report = await addGlobalCoverageReport(coverage, options);
|
|
24
24
|
artifacts.push(report);
|
|
25
25
|
}
|
|
26
26
|
return artifacts;
|
package/lib/index.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ export function addCoverageReport(
|
|
|
32
32
|
testInfo: TestInfo
|
|
33
33
|
): Promise<any | void>;
|
|
34
34
|
|
|
35
|
+
// exporting for other test runner (issue #61)
|
|
36
|
+
export function addGlobalCoverageReport(
|
|
37
|
+
dataList: any[],
|
|
38
|
+
reporterOptions: any
|
|
39
|
+
): Promise<any>;
|
|
40
|
+
|
|
35
41
|
export type CoverageReportOptions = {
|
|
36
42
|
|
|
37
43
|
title?: string,
|
package/lib/index.js
CHANGED
|
@@ -7,7 +7,9 @@ const { getTrends } = require('./common.js');
|
|
|
7
7
|
|
|
8
8
|
const merge = require('./merge-data.js');
|
|
9
9
|
const { attachAuditReport } = require('./plugins/audit/audit.js');
|
|
10
|
-
const {
|
|
10
|
+
const {
|
|
11
|
+
addCoverageReport, addGlobalCoverageReport, attachCoverageReport
|
|
12
|
+
} = require('./plugins/coverage/coverage.js');
|
|
11
13
|
const { attachNetworkReport } = require('./plugins/network/network.js');
|
|
12
14
|
|
|
13
15
|
const { createStateServer, useState } = require('./plugins/state/state.js');
|
|
@@ -22,6 +24,7 @@ class Reporter {
|
|
|
22
24
|
static attachAuditReport = attachAuditReport;
|
|
23
25
|
|
|
24
26
|
static addCoverageReport = addCoverageReport;
|
|
27
|
+
static addGlobalCoverageReport = addGlobalCoverageReport;
|
|
25
28
|
static attachCoverageReport = attachCoverageReport;
|
|
26
29
|
|
|
27
30
|
static attachNetworkReport = attachNetworkReport;
|
package/lib/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ export const merge = MonocartReporter.merge;
|
|
|
8
8
|
export const attachAuditReport = MonocartReporter.attachAuditReport;
|
|
9
9
|
|
|
10
10
|
export const addCoverageReport = MonocartReporter.addCoverageReport;
|
|
11
|
+
export const addGlobalCoverageReport = MonocartReporter.addGlobalCoverageReport;
|
|
11
12
|
export const attachCoverageReport = MonocartReporter.attachCoverageReport;
|
|
12
13
|
|
|
13
14
|
export const attachNetworkReport = MonocartReporter.attachNetworkReport;
|
|
@@ -250,7 +250,7 @@ const getGlobalCoverageData = async (dataList, options) => {
|
|
|
250
250
|
};
|
|
251
251
|
|
|
252
252
|
// global coverage report, run different process with addCoverageReport
|
|
253
|
-
const
|
|
253
|
+
const addGlobalCoverageReport = async (dataList, reporterOptions) => {
|
|
254
254
|
|
|
255
255
|
Util.logInfo('generating global coverage report ...');
|
|
256
256
|
|
|
@@ -306,6 +306,6 @@ const generateGlobalCoverageReport = async (dataList, reporterOptions) => {
|
|
|
306
306
|
|
|
307
307
|
module.exports = {
|
|
308
308
|
addCoverageReport,
|
|
309
|
-
|
|
309
|
+
addGlobalCoverageReport,
|
|
310
310
|
attachCoverageReport
|
|
311
311
|
};
|