@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.
- package/README.md +1 -1
- package/index.js +6 -1
- 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: '
|
|
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
|
-
|
|
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;
|