jdx/stdout-stderr

stdout.write doesn't call callback

jeduden opened this issue · 0 comments

I noticed that the stdout.write mock doesn't call the optional callback argument.

compare https://github.com/jdxcode/stdout-stderr/blob/master/src/index.ts#L44
with
https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_writable_write_chunk_encoding_callback :

writable.write(chunk[, encoding][, callback])
[...]
callback Callback for when this chunk of data is flushed

I would expect the mock function to call the callback if present.