Skip to content

Commit

Permalink
fix(parallel): 'XUNIT' and 'JSON' reporter crash (#4623)
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisman authored Aug 26, 2021
1 parent 014e47a commit 9e0369b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion lib/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ Hook.prototype.error = function(err) {
*/
Hook.prototype.serialize = function serialize() {
return {
$$isPending: this.isPending(),
$$currentRetry: this.currentRetry(),
$$fullTitle: this.fullTitle(),
$$isPending: Boolean(this.isPending()),
$$titlePath: this.titlePath(),
ctx:
this.ctx && this.ctx.currentTest
Expand All @@ -73,9 +75,13 @@ Hook.prototype.serialize = function serialize() {
}
}
: {},
duration: this.duration,
file: this.file,
parent: {
$$fullTitle: this.parent.fullTitle(),
[MOCHA_ID_PROP_NAME]: this.parent.id
},
state: this.state,
title: this.title,
type: this.type,
[MOCHA_ID_PROP_NAME]: this.id
Expand Down
4 changes: 2 additions & 2 deletions lib/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,10 @@ Suite.prototype.serialize = function serialize() {
return {
_bail: this._bail,
$$fullTitle: this.fullTitle(),
$$isPending: this.isPending(),
$$isPending: Boolean(this.isPending()),
root: this.root,
title: this.title,
id: this.id,
[MOCHA_ID_PROP_NAME]: this.id,
parent: this.parent ? {[MOCHA_ID_PROP_NAME]: this.parent.id} : null
};
};
Expand Down
2 changes: 1 addition & 1 deletion lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Test.prototype.serialize = function serialize() {
return {
$$currentRetry: this._currentRetry,
$$fullTitle: this.fullTitle(),
$$isPending: this.pending,
$$isPending: Boolean(this.pending),
$$retriedTest: this._retriedTest || null,
$$slow: this._slow,
$$titlePath: this.titlePath(),
Expand Down

0 comments on commit 9e0369b

Please sign in to comment.