monocart-reporter 2.9.2 → 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.
@@ -49,7 +49,20 @@ const generateZip = (outputDir, filename, reportData, options) => {
49
49
  return;
50
50
  }
51
51
 
52
- const zipPath = path.resolve(outputDir, `${filename}.zip`);
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
- /** output zip file for all report files */
60
- zip?: boolean;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-reporter",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "description": "A playwright test reporter. Shows suites/cases/steps with tree style, markdown annotations, custom columns/formatters/data collection visitors, console logs, style tags, send email.",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -47,7 +47,7 @@
47
47
  "koa": "^2.15.3",
48
48
  "koa-static-resolver": "^1.0.6",
49
49
  "lz-utils": "^2.1.0",
50
- "monocart-coverage-reports": "^2.11.0",
50
+ "monocart-coverage-reports": "^2.11.1",
51
51
  "monocart-locator": "^1.0.2",
52
52
  "nodemailer": "^6.9.15"
53
53
  },
@@ -60,7 +60,7 @@
60
60
  "axios": "^1.7.7",
61
61
  "commander": "^12.1.0",
62
62
  "dotenv": "^16.4.5",
63
- "eslint": "^9.11.1",
63
+ "eslint": "^9.12.0",
64
64
  "eslint-config-plus": "^2.0.2",
65
65
  "eslint-plugin-html": "^8.1.2",
66
66
  "eslint-plugin-vue": "^9.28.0",