Closed lozadaOmr closed 1 year ago
middlewareCall is a promise
So I did access stubbed next.called
, res.json.called
, secretsWriteStub.called
by adding a then block
middlewareCall
.then(() => {
// assertion now goes in here
console.log(`next stub ====> `, next.called)
console.log(`resJsonStub =====> `, res.json.called)
console.log(`secretswrite ====> `, secretsWriteStub.called)
done()
})
Only problem with this is that, when assertion fails I receive a an error, instead of telling me which assertion fails
Sinon version : 15.0.3
Environment : NodeJS
Other libraries you are using:
What did you expect to happen?
findByIdStub.called
,secretsWriteStub.called
andnext.called
be equal to true on the test fileWhat actually happens
findByIdStub
) has the.called
equal to true, while the rest resulted in falsestub.resolve()
is not behaving as expectedHow to reproduce
gulp test