mocha-qase-reporter 1.1.2 → 1.1.4

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/changelog.md CHANGED
@@ -1,3 +1,16 @@
1
+ # qase-mocha@1.1.4
2
+
3
+ ## What's new
4
+
5
+ - Fixed an issue with the parallel mode compatibility with Mocha 11.0.0.
6
+
7
+ # qase-mocha@1.1.3
8
+
9
+ ## What's new
10
+
11
+ - Added support for status filter in the test run.
12
+ - Improved error handling.
13
+
1
14
  # qase-mocha@1.1.0
2
15
 
3
16
  ## What's new
package/dist/parallel.js CHANGED
@@ -7,15 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  // @ts-expect-error
8
8
  const parallel_buffered_js_1 = __importDefault(require("mocha/lib/nodejs/reporters/parallel-buffered.js"));
9
9
  const reporter_js_1 = require("./reporter.js");
10
+ class QaseParallelReporter extends parallel_buffered_js_1.default {
11
+ constructor(runner, opts) {
12
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
13
+ super(runner, opts);
14
+ const qaseOpts = { ...opts, parallel: false };
15
+ new reporter_js_1.MochaQaseReporter(runner, qaseOpts);
16
+ }
17
+ }
10
18
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11
- const originalCreateListeners =
12
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
13
- parallel_buffered_js_1.default.prototype.createListeners;
14
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
15
- parallel_buffered_js_1.default.prototype.createListeners = function (runner) {
16
- console.log("createListeners");
17
- const result = originalCreateListeners.call(this, runner);
18
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
19
- new reporter_js_1.MochaQaseReporter(runner, this.options);
20
- return result;
21
- };
19
+ module.exports = QaseParallelReporter;
20
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
21
+ module.exports.default = QaseParallelReporter;
package/dist/reporter.js CHANGED
@@ -56,6 +56,11 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
56
56
  if (options.parallel) {
57
57
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
58
58
  options.require = [...(options.require ?? []), resolveParallelModeSetupFile()];
59
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
60
+ if (this.runner && typeof this.runner.workerReporter === 'function') {
61
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
62
+ this.runner.workerReporter(resolveParallelModeSetupFile());
63
+ }
59
64
  }
60
65
  else {
61
66
  this.applyListeners();
@@ -174,9 +179,7 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
174
179
  steps: this.currentTest.steps,
175
180
  id: (0, uuid_1.v4)(),
176
181
  execution: {
177
- status: test.state
178
- ? MochaQaseReporter.statusMap[test.state]
179
- : qase_javascript_commons_1.TestStatusEnum.invalid,
182
+ status: (0, qase_javascript_commons_1.determineTestStatus)(test.err ?? null, test.state ?? 'failed'),
180
183
  start_time: this.testBeginTime / 1000,
181
184
  end_time: end_time / 1000,
182
185
  duration: duration,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocha-qase-reporter",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Mocha Cypress Reporter",
5
5
  "homepage": "https://github.com/qase-tms/qase-javascript",
6
6
  "sideEffects": false,
@@ -41,9 +41,9 @@
41
41
  "author": "Qase Team <support@qase.io>",
42
42
  "license": "Apache-2.0",
43
43
  "dependencies": {
44
- "mocha": "^10.2.0",
44
+ "mocha": "^11.0.0",
45
45
  "deasync-promise": "^1.0.1",
46
- "qase-javascript-commons": "~2.4.1",
46
+ "qase-javascript-commons": "~2.4.4",
47
47
  "uuid": "^9.0.1"
48
48
  },
49
49
  "devDependencies": {