Skip to content

Commit 59eb796

Browse files
keep asyncResource property
1 parent 5413b06 commit 59eb796

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • packages/datadog-instrumentations/src

packages/datadog-instrumentations/src/mocha.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,13 @@ addHook({
418418

419419
// we store the original function, not to lose it
420420
originalFns.set(newFn, this.fn)
421-
422421
this.fn = newFn
422+
423+
// Temporarily keep functionality when .asyncResource is removed from node
424+
// in https://github.com/nodejs/node/pull/46432
425+
if (!this.fn.asyncResource) {
426+
this.fn.asyncResource = asyncResource
427+
}
423428
}
424429
}
425430

0 commit comments

Comments
 (0)