fix: use 127.0.0.1 in test to explicitly listen on IPv4 interface#215
fix: use 127.0.0.1 in test to explicitly listen on IPv4 interface#215lionralfs wants to merge 3 commits intomswjs:mainfrom
Conversation
|
Hey, @lionralfs. Thanks for submitting this pull request! So, does this mean you can no longer construct a |
|
This is just a change for the test case, so that tests don't break in newer node versions. Also, you should still be able to use localhost in the More info (from nodejs/node#39987):
|
|
Hey, @lionralfs. Thanks for opening this! We don't currently have official support for Node 17. While the library should work there, our test suite is meant to be run on Node 14/16. I'm putting this change on hold until we adopt Node 17 as the official development version. |
- Closes #215 Migrating away from < Node 18 for happier life.
Released: v0.21.1 🎉This has been released in v0.21.1! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Hey,
tests in node >= 17.0.0 are not passing due to the way in which
localhostgets resolved. From (nodejs/node#40537 (comment)):This change was introduced in nodejs/node#39987 (node v17.0.0), causing this test to fail:
interceptors/src/interceptors/ClientRequest/NodeClientRequest.test.ts
Lines 151 to 170 in 4563ce7
localhostresolves to the IPv6 address::1which means that the lineexpect(error.address).toEqual('127.0.0.1')fails.This PR changes the test to explicitly listen on the IPv4 equivalent.