oclif / fancy-test

extends mocha with helpful, chainable extensions

Home Page:https://npmjs.com/package/fancy-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stdin not closed after sending input

tchaumeny opened this issue · 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.