Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created February 11, 2020 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/de51aa6a1351ff68e844bc81ae908da2 to your computer and use it in GitHub Desktop.
Save isaacs/de51aa6a1351ff68e844bc81ae908da2 to your computer and use it in GitHub Desktop.
const nock = require('nock')
const server = nock('http://localhost')
const CONTENT = 'this is fine'
server
.get('/test')
.times(1)
.reply(200, CONTENT)
const fetch = require('./')
fetch('http://localhost/test')
.then(() => fetch('http://localhost/test'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment