Error observed while testing w/ nock
See original GitHub issueI’m getting the following error when running a test that uses nock.
TypeError: Cannot read property '_redirectable' of undefined
at eventHandlers.(anonymous function) (node_modules/follow-redirects/index.js:22:7)
at OverriddenClientRequest.RequestOverrider.req.once.req.on (node_modules/nock/lib/request_overrider.js:195:7)
at Writable.RedirectableRequest._performRequest (node_modules/follow-redirects/index.js:69:12)
at Writable.RedirectableRequest (node_modules/follow-redirects/index.js:46:7)
at Object.wrappedProtocol.request (node_modules/follow-redirects/index.js:202:10)
at Object.wrappedProtocol.get (node_modules/follow-redirects/index.js:207:33)
at getLatestUrl (lib/update.js:21:13)
...
The error doesn’t happen when I run the program regularly. See this travis build for more context.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Error observed while testing w/ nock · Issue #48 · follow-redirects ...
I'm getting the following error when running a test that uses nock. TypeError: Cannot read property '_redirectable' of undefined at eventHandlers.
Read more >API mock testing with Nock - CircleCI
This tutorial will show you how to mock HTTP requests from an API so that you can test endpoints without really calling them...
Read more >Nock fails to intercept requests in tests, but only in --coverage ...
I am mocking all the API calls with nock in the tests and all the tests that are supposed to mock a successful...
Read more >Controlling axios HTTP error handling and test it using nock + ...
Conclusion. In this article I have shown how to control of the axios HTTP client library's error emitting mechanism, and how to set...
Read more >Mocking HTTP requests with Nock - codeburst
Tests that make real HTTP requests to external services can be error-prone for a variety of reasons. Examples include the exact data returned...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s a nock bug: node-nock/nock#769.
had the same issue, upgrading to latest version fixed it.