-
-
Save isaacs/4a3abdc4e794190cc370fa501762dd94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nock = require('nock') | |
const server = nock('http://localhost:8080') | |
const CONTENT = 'this is fine' | |
server | |
.get('/test') | |
.times(1) | |
.reply(200, CONTENT) | |
const fetch = require('./') | |
require('http').createServer((q, s) => s.end('from the other server')) | |
.listen(8080) | |
fetch('http://localhost:8080/test') | |
.then(() => fetch('http://localhost:8080/test')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment