@reporters/mocha 1.0.1 → 1.0.3
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/index.js +3 -2
- package/package.json +1 -1
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
|
}
|
|
@@ -164,7 +165,7 @@ class Runner extends EventEmitter {
|
|
|
164
165
|
|
|
165
166
|
#report(suite = this.#root) {
|
|
166
167
|
/* Not like mocha, node:test runs tests as soon as they are encountered
|
|
167
|
-
so the exact structure is
|
|
168
|
+
so the exact structure is unknown until all suites end */
|
|
168
169
|
this.emit(EVENT_SUITE_BEGIN, suite);
|
|
169
170
|
suite.finalize();
|
|
170
171
|
for (const s of suite.suites) {
|