Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Error readable to mock error #62

Open
daisy1754 opened this issue Jul 14, 2020 · 1 comment · May be fixed by #64
Open

[FEATURE] Error readable to mock error #62

daisy1754 opened this issue Jul 14, 2020 · 1 comment · May be fixed by #64
Assignees
Labels
enhancement New feature or request

Comments

@daisy1754
Copy link

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"));
@daisy1754 daisy1754 added the enhancement New feature or request label Jul 14, 2020
@b4nst b4nst self-assigned this Jul 16, 2020
@b4nst
Copy link
Owner

b4nst commented Jul 16, 2020

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.

@daisy1754 daisy1754 linked a pull request Oct 2, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants