monocart-reporter 1.7.8 → 1.7.9

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/visitor.js CHANGED
@@ -1,7 +1,9 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
  const EC = require('eight-colors');
4
- const { StackUtils, codeFrameColumns } = require('./runtime/monocart-vendor.js');
4
+ const {
5
+ StackUtils, codeFrameColumns, sanitize
6
+ } = require('./runtime/monocart-vendor.js');
5
7
  const Util = require('./utils/util.js');
6
8
  const commentsPlugin = require('./plugins/comments.js');
7
9
  const defaultColumns = require('./default/columns.js');
@@ -601,12 +603,14 @@ class Visitor {
601
603
  'application/octet-stream': 'data'
602
604
  };
603
605
 
606
+ const filename = sanitize(`${item.name}-${i + 1}`);
607
+
604
608
  let ext = 'data';
605
609
  const contentType = item.contentType;
606
610
  if (contentType) {
607
611
  ext = types[contentType] || contentType.split('/').pop().slice(0, 4);
608
612
  }
609
- const filePath = path.resolve(attachmentsPath, `${item.name}-${i + 1}.${ext}`);
613
+ const filePath = path.resolve(attachmentsPath, `${filename}.${ext}`);
610
614
  fs.writeFileSync(filePath, item.body);
611
615
  item.path = filePath;
612
616
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-reporter",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
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": {