Skip to content

Commit

Permalink
keep asyncResource property
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Feb 2, 2023
1 parent 5413b06 commit 59eb796
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/datadog-instrumentations/src/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,13 @@ addHook({

// we store the original function, not to lose it
originalFns.set(newFn, this.fn)

this.fn = newFn

// Temporarily keep functionality when .asyncResource is removed from node
// in https://github.com/nodejs/node/pull/46432
if (!this.fn.asyncResource) {
this.fn.asyncResource = asyncResource
}
}
}

Expand Down

0 comments on commit 59eb796

Please sign in to comment.