monocart-reporter 2.9.1 → 2.9.3
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-report.js
CHANGED
|
@@ -49,7 +49,20 @@ const generateZip = (outputDir, filename, reportData, options) => {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
let zipPath = path.resolve(outputDir, `${filename}.zip`);
|
|
53
|
+
if (typeof options.zip === 'string') {
|
|
54
|
+
zipPath = options.zip;
|
|
55
|
+
if (!zipPath.endsWith('.zip')) {
|
|
56
|
+
zipPath += '.zip';
|
|
57
|
+
}
|
|
58
|
+
const zipDir = path.dirname(zipPath);
|
|
59
|
+
if (!fs.existsSync(zipDir)) {
|
|
60
|
+
fs.mkdirSync(zipDir, {
|
|
61
|
+
recursive: true
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
53
66
|
const reportFiles = [];
|
|
54
67
|
return new Promise((resolve) => {
|
|
55
68
|
const zipFile = new ZipFile();
|
package/lib/index.d.ts
CHANGED
|
@@ -56,8 +56,12 @@ export type MonocartReporterOptions = {
|
|
|
56
56
|
|
|
57
57
|
/** output json file for data only */
|
|
58
58
|
json?: boolean;
|
|
59
|
-
|
|
60
|
-
zip
|
|
59
|
+
|
|
60
|
+
/** output zip file for all report files
|
|
61
|
+
* {boolean} using default path
|
|
62
|
+
* {string} zip file path
|
|
63
|
+
*/
|
|
64
|
+
zip?: boolean | string;
|
|
61
65
|
|
|
62
66
|
/**
|
|
63
67
|
* whether to copy attachments to the reporter output dir, defaults to true
|