-
Notifications
You must be signed in to change notification settings - Fork 247
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
Feat: Simulate nodejs-level errors ? #365
Comments
@GerkinDev can you still prepare the PR, this looks like its really needs to be added |
I'll do that tomorrow, and publish a built git branch you'll be able to install directly |
GerkinDev
added a commit
to craft-ai/fork-axios-mock-adapter
that referenced
this issue
Apr 19, 2024
Done. @mnikolaus you should be able to install it using |
GerkinDev
added a commit
to craft-ai/fork-axios-mock-adapter
that referenced
this issue
Oct 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
For testing purpose, I wanted to check the behavior of my application when receiving errors
ECONNRESET
,ENOTFOUND
,ECONNREFUSED
orEHOSTUNREACH
, and the only solution I found (after quite some time of research) was to do the following:While it seems to be working as expected, it's rather verbose, and would be super useful to have helpers to throw such errors.
I've made a runkit with a few samples of those errors:
https://runkit.com/embed/12bax0k5843m
Proposal:
Add an optional parameter to
networkError
, which would be thecode
of the error to throw. For what I've seen, errors could look like this:I'm OK to PR
The text was updated successfully, but these errors were encountered: