nock/nock issue #2253

node v16.18.0
version: 1.0.0
endpointsharetweet
const nock = require('nock@13.1.3') const scope = nock('http://localhost') const axios = require('axios') scope.get('/boo') .reply(200, 'ok') try{ await axios.get('http://localhost/boo') console.log('OK, Expected to match') }catch(e) { console.log('Not matched?') console.log(e) } nock.cleanAll() scope .matchHeader('authorization','foo') .get('/boo') .reply(200, 'ok') try{ await axios.get('http://localhost/boo') }catch(e) { console.log('OK, expected header not match') console.log(e) } nock.cleanAll() scope.get('/boo') .reply(200, 'ok') try{ await axios.get('http://localhost/boo') console.log('OK, Expected to match') }catch(e) { console.log('Not matched?') console.log(e) }
Loading…

no comments

    sign in to comment