node
node copied to clipboard
doc: call out potentially unexpected results when mocking and testing synchronous callback-based APIs
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.
Review requested:
- [ ] @nodejs/test_runner