| 1 |
'use strict' |
| 2 |
|
| 3 |
const nock = require('nock') |
| 4 |
|
| 5 |
module.exports = tnock |
| 6 |
function tnock (t, host) { |
| 7 |
const server = nock(host) |
| 8 |
nock.disableNetConnect() |
| 9 |
t.teardown(function () { |
| 10 |
nock.enableNetConnect() |
| 11 |
server.done() |
| 12 |
}) |
| 13 |
return server |
| 14 |
} |