Error while using nocks
See original GitHub issueHey, I am receiving the following error when I’m trying to post a multipart form data from nock.
Failed: Cannot read property 'status' of undefined
TypeError: Cannot read property 'status' of undefined
at /Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/dist/apisauce.js:205:49
at /Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/node_modules/ramda/src/cond.js:42:30
at /Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/node_modules/ramda/src/internal/_arity.js:5:45
at getProblemFromError (/Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/dist/apisauce.js:206:186)
at convertResponse (/Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/dist/apisauce.js:174:29)
at /Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/node_modules/ramda/src/internal/_createPartialApplicator.js:8:17
at /Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/node_modules/ramda/src/internal/_arity.js:5:45
at /Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/node_modules/ramda/src/internal/_pipe.js:3:27
at /Users/vcashik/workspace/ReactNativeApp/node_modules/apisauce/node_modules/ramda/src/internal/_arity.js:5:45
at tryCallOne (/Users/vcashik/workspace/ReactNativeApp/node_modules/promise/lib/core.js:37:12)
This error is weird and I am breaking my head for a day on this. I hope that someone can help before I fix my head.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
How to test error in request with Nock? - Stack Overflow
I want to test the error in a request return. I'm using nock in my tests, how can I force Nock to provoke...
Read more >Why nock throw error `Nock: No match for request ... - GitHub
When you use mocking api once then it removed. use persist ...
Read more >nock.Interceptor.replyWithError JavaScript and Node.js code ...
Best JavaScript code snippets using nock.Interceptor. ... it('throws correct error with request error', async function () { nock(this.
Read more >No match error when testing an Express.js controller doing ...
I had a controller requesting the same backend service but onto 2 different endpoints. My intent was to mock these calls using the...
Read more >How to use the nock.isDone function in nock - Snyk
To help you get started, we've selected a few nock examples, based on popular ways it is used in ... isDone()) { console.error('pending...
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
Hey, I just added a simple validation in
getProblemFromError()
to check whether the error has a response or not.(For anyone getting from Google and trying to make
apisauce
work withnock
in React Native:We basically override
apisauce.create
method, add forcefully add anaxios
instance -> which then allows us to usenock
.