TypeError: Cannot read property 'isMap' of undefined while setting headers in reply() #2347
Unanswered
suhail-1997
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The issue has to do with using Node 8. The last few major versions of Nock require Node 10+. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I am facing TypeError: Cannot read property 'isMap' of undefined error while setting header in the reply() of nock.
code
setupMockHttpGet(url1, 503, {
"token": "null",
"events": [],
"ok": false
}, {'retry-after': 2});
function setupMockHttpGet(path: string, statusCode: number, response: any, headers?: any) {
return nock(url).get(path).reply(statusCode, response, headers);
}
i have tried using Map() method of typescript like below
let headers = new Map();
headers.set('retry-after',2);
setupMockHttpGet(url1, 503, {
"token": "null",
"events": [],
"ok": false
}, headers);
still facing the same issue.
I'm facing this issue after upgrading the nock from 9.2.5 to 13.2.4
my project versions are as follows
electron : 2.0.12
node: 8.9.3
typescript: 3.2.2
can anyone please help me with this?
Beta Was this translation helpful? Give feedback.
All reactions