monocart-reporter 2.4.7 → 2.4.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/utils/util.js CHANGED
@@ -8,7 +8,7 @@ const CG = require('console-grid');
8
8
  const Share = require('../platform/share.js');
9
9
  const { deflateSync } = require('lz-utils');
10
10
 
11
- const defaultOptions = require('../default/options.js');
11
+ const getDefaultOptions = require('../default/options.js');
12
12
 
13
13
  const assetsName = 'assets';
14
14
 
@@ -90,7 +90,7 @@ const Util = {
90
90
  }
91
91
  // then check string
92
92
  if (!outputFile || typeof outputFile !== 'string') {
93
- outputFile = defaultOptions.outputFile;
93
+ outputFile = getDefaultOptions().outputFile;
94
94
  }
95
95
  return path.resolve(outputFile);
96
96
  },
package/lib/visitor.js CHANGED
@@ -6,7 +6,7 @@ const {
6
6
  } = require('./packages/monocart-vendor.js');
7
7
  const Util = require('./utils/util.js');
8
8
  const commentsPlugin = require('./plugins/comments.js');
9
- const defaultColumns = require('./default/columns.js');
9
+ const getDefaultColumns = require('./default/columns.js');
10
10
 
11
11
  // retired, just warning for old babel parser
12
12
  let collectWarning = '"collect.comments()" has been deprecated (replaced with new option "customFieldsInComments: true/false" in version 2.2.0), please remove the code related to "collect.comments()" in custom "visitor".';
@@ -35,8 +35,9 @@ class Visitor {
35
35
 
36
36
  async start() {
37
37
 
38
+ const columns = getDefaultColumns();
38
39
  // default columns not detailed in report
39
- defaultColumns.forEach((item) => {
40
+ columns.forEach((item) => {
40
41
  item.detailed = false;
41
42
  });
42
43
 
@@ -45,16 +46,16 @@ class Visitor {
45
46
 
46
47
  // user defined custom columns
47
48
  const handler = this.options.columns;
48
- if (typeof handler === 'function') {
49
+ if (!this.columnsUpdated && typeof handler === 'function') {
49
50
  // prevent repeated execution
50
- this.options.columns = null;
51
+ this.columnsUpdated = true;
51
52
 
52
53
  // update default columns by user
53
- handler.call(this, defaultColumns);
54
+ handler.call(this, columns);
54
55
 
55
56
  // maybe a tree
56
57
  const customVisitors = [];
57
- this.initCustomHandler(defaultColumns, customVisitors, this.formatters);
58
+ this.initCustomHandler(columns, customVisitors, this.formatters);
58
59
  if (customVisitors.length) {
59
60
  this.customVisitors = customVisitors;
60
61
  }
@@ -62,7 +63,7 @@ class Visitor {
62
63
 
63
64
  // console.log(customFormatters);
64
65
 
65
- this.columns = defaultColumns;
66
+ this.columns = columns;
66
67
  this.rows = [];
67
68
  this.jobs = [];
68
69
  this.artifacts = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-reporter",
3
- "version": "2.4.7",
3
+ "version": "2.4.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": {
@@ -47,22 +47,22 @@
47
47
  "koa": "^2.15.3",
48
48
  "koa-static-resolver": "^1.0.6",
49
49
  "lz-utils": "^2.0.2",
50
- "monocart-coverage-reports": "^2.8.2",
50
+ "monocart-coverage-reports": "^2.8.3",
51
51
  "monocart-formatter": "^3.0.0",
52
52
  "monocart-locator": "^1.0.0",
53
53
  "nodemailer": "^6.9.13",
54
- "turbogrid": "^3.0.13"
54
+ "turbogrid": "^3.1.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@playwright/test": "^1.44.0",
58
- "axios": "^1.6.8",
57
+ "@playwright/test": "^1.44.1",
58
+ "axios": "^1.7.2",
59
59
  "dotenv": "^16.4.5",
60
- "eslint": "^9.3.0",
61
- "eslint-config-plus": "^2.0.0",
60
+ "eslint": "^9.4.0",
61
+ "eslint-config-plus": "^2.0.1",
62
62
  "eslint-plugin-html": "^8.1.1",
63
63
  "eslint-plugin-vue": "^9.26.0",
64
64
  "open": "8.4.2",
65
- "stylelint": "^16.5.0",
65
+ "stylelint": "^16.6.1",
66
66
  "stylelint-config-plus": "^1.1.2",
67
67
  "vine-ui": "^3.1.13"
68
68
  }