Skip to content

Commit 9e0369b

Browse files
authoredAug 26, 2021
fix(parallel): 'XUNIT' and 'JSON' reporter crash (#4623)
1 parent 014e47a commit 9e0369b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
 

‎lib/hook.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ Hook.prototype.error = function(err) {
6262
*/
6363
Hook.prototype.serialize = function serialize() {
6464
return {
65-
$$isPending: this.isPending(),
65+
$$currentRetry: this.currentRetry(),
66+
$$fullTitle: this.fullTitle(),
67+
$$isPending: Boolean(this.isPending()),
6668
$$titlePath: this.titlePath(),
6769
ctx:
6870
this.ctx && this.ctx.currentTest
@@ -73,9 +75,13 @@ Hook.prototype.serialize = function serialize() {
7375
}
7476
}
7577
: {},
78+
duration: this.duration,
79+
file: this.file,
7680
parent: {
81+
$$fullTitle: this.parent.fullTitle(),
7782
[MOCHA_ID_PROP_NAME]: this.parent.id
7883
},
84+
state: this.state,
7985
title: this.title,
8086
type: this.type,
8187
[MOCHA_ID_PROP_NAME]: this.id

‎lib/suite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -594,10 +594,10 @@ Suite.prototype.serialize = function serialize() {
594594
return {
595595
_bail: this._bail,
596596
$$fullTitle: this.fullTitle(),
597-
$$isPending: this.isPending(),
597+
$$isPending: Boolean(this.isPending()),
598598
root: this.root,
599599
title: this.title,
600-
id: this.id,
600+
[MOCHA_ID_PROP_NAME]: this.id,
601601
parent: this.parent ? {[MOCHA_ID_PROP_NAME]: this.parent.id} : null
602602
};
603603
};

‎lib/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Test.prototype.serialize = function serialize() {
9292
return {
9393
$$currentRetry: this._currentRetry,
9494
$$fullTitle: this.fullTitle(),
95-
$$isPending: this.pending,
95+
$$isPending: Boolean(this.pending),
9696
$$retriedTest: this._retriedTest || null,
9797
$$slow: this._slow,
9898
$$titlePath: this.titlePath(),

0 commit comments

Comments
 (0)
Please sign in to comment.