fancy-test icon indicating copy to clipboard operation
fancy-test copied to clipboard

stdin not closed after sending input

Open tchaumeny opened this issue 5 years ago • 0 comments

In the current implementation, mock-stdin is not ended after passing it the input (see https://github.com/caitp/node-mock-stdin/blob/master/lib/mock/stdin.js#L132 for the end method).

This causes test reading from stdin to hang forever.

Since we have no access to the underlying mock-stdin instance, we cannot do it ourself.

Calling stdin.end() in https://github.com/jdxcode/fancy-test/blob/d89fed06192386a91cdae088a282236c06291dd5/src/stdmock.ts#L25 seems to solve this issue.

tchaumeny avatar May 13 '19 10:05 tchaumeny