stream-mock
stream-mock copied to clipboard
[FEATURE] Error readable to mock error
Is your feature request related to a problem? Please describe. I have a program to read data from the stream. I want to write a test to cover the error path.
readStream.on("error", {
// I want to run code here in my unit test
});
Describe the solution you'd like
It would be nice if the library can provide ErrorReadble
which I can pass error object
const mock = new ErrorReadble(new Error("mock error"));
Should not be difficult, let me try something when I found some time (probably this weekend). Feel free to open a PR in the meantime if you wish to contribute.