node icon indicating copy to clipboard operation
node copied to clipboard

doc: call out potentially unexpected results when mocking and testing synchronous callback-based APIs

Open filmaj opened this issue 7 months ago • 1 comments

This PR fixes https://github.com/nodejs/node/issues/58161.

When mocking synchronous callback-based APIs, the MockFunctionContext tracking mock calls won't be register until after the mock function finishes execution. Tests exercising callback-based code will likely not be written in a way to ensure this is the case. As such, call this out in the documentation.

filmaj avatar May 04 '25 18:05 filmaj

Review requested:

  • [ ] @nodejs/test_runner

nodejs-github-bot avatar May 04 '25 18:05 nodejs-github-bot