Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
nock/nock#1076
node v8.17.0
version:
1.0.0
endpoint
share
tweet
Test case for https://github.com/node-nock/nock/issues/1076
const nock922 = require('nock@9.2.2') const got = require('got') nock922(/localhost/, {allowUnmocked: true}) .get('/no/regex/here') .reply(200, 'Match regex'); try { await got('http://localhost:3000/no/regex/here'); console.log('nock@9.2.2 is ok') } catch (error) { console.log('nock@9.2.2 is not ok') }
const nock921 = require('nock@9.2.1') nock921(/localhost/, {allowUnmocked: true}) .get('/no/regex/here') .reply(200, 'Match regex'); try { await got('http://localhost:3000/no/regex/here'); console.log('nock@9.2.1 is ok') } catch (error) { console.log('nock@9.2.1 is not ok') }
Loading…
no comments
sign in
to comment