I want to have a code like this:
describe('populate', function() {
it('should grab ', function() {
nock('http://someapi.com')
.post('/attractions')
.reply(200, [])
return request
.post('http://someapi.com/wrong')
.send({destId: id})
.catch(() =>
expect(nock.unsatisfaedMocks()).is.eql(['http://someapi.com/wrong'])
)
})
})
Is it possible?
Of course you can
we usually stick for
assert.strictEqual(nock.isDone(), true, nock.pendingMocks())
nock.isDone()
checks if all defined nock are triggered (globally)
nock.pendingMocks()
returns array of not-called nocks