1'use strict' 2 3const nock = require('nock') 4 5// Uncomment this to find requests that aren't matching 6// nock.emitter.on('no match', req => console.log(req.options)) 7 8module.exports = tnock 9function tnock (t, host, opts) { 10 nock.disableNetConnect() 11 const server = nock(host, opts) 12 t.teardown(function () { 13 nock.enableNetConnect() 14 server.done() 15 }) 16 return server 17} 18