nock/nock#2197 test case

node v14.20.1
version: 1.0.0
endpointsharetweet
Reproduceable testcase for https://github.com/nock/nock/issues/2197.
const nock = require('nock@13.0.11') const fetch = require('node-fetch@2.6.1') const data = {foo: 'bar'} nock('http://example.com') .post("/baz", {foo: 'bar'}) .reply(function() { console.log(this.req.headers); return [200, 'blah']; }) fetch('http://example.com/baz', { method: 'POST', body: JSON.stringify(data) }).catch(console.error); // Logs headers object with arrays
Loading…

no comments

    sign in to comment