@reporters/mocha 1.0.0 → 1.0.2

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +6 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -19,7 +19,7 @@ yarn add --dev @reporters/mocha
19
19
  Specify the desired mocha reporter inside the [mocha configuration file](https://mochajs.org/#configuring-mocha-nodejs), e.g. `.mocharc.js`:
20
20
  ```js
21
21
  module.exports = {
22
- reporter: '@reporters/mocha'
22
+ reporter: 'nyan'
23
23
  }
24
24
  ```
25
25
 
package/index.js CHANGED
@@ -53,7 +53,8 @@ class Test {
53
53
  this.file = event.data.file;
54
54
  this.pending = Boolean(event.data.skip || event.data.todo);
55
55
  this.duration = event.data.details?.duration_ms;
56
- this.err = event.data.details?.error;
56
+ const error = event.data.details?.error;
57
+ this.err = error?.cause instanceof Error ? error.cause : error;
57
58
  this.passed = passed;
58
59
  this.nesting = event.data.nesting;
59
60
  }
@@ -145,6 +146,10 @@ class Runner extends EventEmitter {
145
146
  this.emit(EVENT_RUN_BEGIN);
146
147
  }
147
148
 
149
+ get suite() {
150
+ return this.#current;
151
+ }
152
+
148
153
  end() {
149
154
  if (!this.#reporter) {
150
155
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reporters/mocha",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "use any mocha reporter with `node:test`",
5
5
  "type": "commonjs",
6
6
  "keywords": [