How to use the emitter function from nock
Find comprehensive JavaScript nock.emitter code examples handpicked from public code repositorys.
25 26 27 28 29 30 31 32 33 34 35
}; function initNock() { nock.disableNetConnect(); const logRequest = (r) => console.log(`No match: ${r.path}, method: ${r.method}, host: ${r.options.host}`); nock.emitter.on('no match', (req) => { logRequest(req); }); }
46
128
0
GitHub: AndrewD314/hyper-wicked
0 1 2 3 4 5 6 7 8 9 10 11 12
'use strict' const nock = require('nock') // Uncomment this to find requests that aren't matching // nock.emitter.on('no match', req => console.log(req.options)) module.exports = tnock function tnock (t, host, opts) { nock.disableNetConnect()
0
0
0
nock.cleanAll is the most popular function in nock (317 examples)