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

Handle http.request() with no options #461

Closed
Tracked by #2517
mikicho opened this issue Sep 29, 2023 · 1 comment · Fixed by #468
Closed
Tracked by #2517

Handle http.request() with no options #461

mikicho opened this issue Sep 29, 2023 · 1 comment · Fixed by #468
Assignees

Comments

@mikicho
Copy link
Contributor

mikicho commented Sep 29, 2023

From nock's source code:

// As weird as it is, it's possible to call http.request without
// options, and it makes a request to localhost or somesuch. We should
// support it too, for parity. However it doesn't work today, and fixing
// it seems low priority. Giving an explicit error is nicer than
// crashing with a weird stack trace. new ClientRequest(), nock's
// other client-facing entry point, makes a similar check.
// nock/nock#1386
// nock/nock#1440

I think we should follow and just throw error. currently we throw:

Cannot use 'in' operator to search for 'hash' in undefined

@kettanaito
Copy link
Member

Released: v0.25.7 🎉

This has been released in v0.25.7!

Make sure to always update to the latest version (npm i @mswjs/interceptors@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants