mocha-qase-reporter 1.0.0-beta.3 → 1.0.0-beta.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,9 @@
1
+ # qase-mocha@1.0.0-beta.4
2
+
3
+ ## What's new
4
+
5
+ Fixed the issue with async tests not being reported correctly.
6
+
1
7
  # qase-mocha@1.0.0-beta.3
2
8
 
3
9
  ## What's new
package/dist/reporter.js CHANGED
@@ -36,7 +36,8 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
36
36
  this.runner.on(Events.EVENT_TEST_BEGIN, (test) => this.addMethods(test.ctx));
37
37
  this.runner.on(Events.EVENT_HOOK_BEGIN, (hook) => this.addMethods(hook.ctx));
38
38
  this.runner.on(Events.EVENT_TEST_BEGIN, () => this.onStartTest());
39
- this.runner.on(Events.EVENT_TEST_END, (test) => this.onEndTest(test));
39
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
40
+ this.runner.on(Events.EVENT_TEST_END, async (test) => await this.onEndTest(test));
40
41
  };
41
42
  this.qaseId = (id) => {
42
43
  this.metadata.addQaseId(id);
@@ -146,7 +147,7 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
146
147
  onStartTest() {
147
148
  this.currentType = 'test';
148
149
  }
149
- onEndTest(test) {
150
+ async onEndTest(test) {
150
151
  if (this.metadata.ignore) {
151
152
  return;
152
153
  }
@@ -197,7 +198,7 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
197
198
  testops_id: ids.length > 0 ? ids : null,
198
199
  title: this.metadata.title && this.metadata.title != '' ? this.metadata.title : test.title,
199
200
  };
200
- (0, deasync_promise_1.default)(this.reporter.addTestResult(result));
201
+ await this.reporter.addTestResult(result);
201
202
  this.metadata.clear();
202
203
  this.currentTest = new currentTest();
203
204
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocha-qase-reporter",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "Mocha Cypress Reporter",
5
5
  "homepage": "https://github.com/qase-tms/qase-javascript",
6
6
  "sideEffects": false,