Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(`${name}: fetches expected data`, (done) => {
const srv = new MockRESTv2Server({ listen: true })
const r = getTestREST2()
const nn = n++
srv.setResponse(dataKey, [nn])
args.push((err, res) => {
if (err) {
return srv.close().then(() => done(err)).catch(done)
}
assert.deepEqual(res, [nn])
srv.close().then(done).catch(done)
})
r[name].apply(r, args)
})