I need to test a promise that should be in a pending state at the moment of the test. I was able to test it doing:
expect(promise).to.eventually.not.be.fulfilled
this expect throws the expected error but it isnt bound to the mochas context so if it fails it won't be reported as a failed test. If I return it or await, the statement will block for 2s and mocha will fail with a timeout, because mocha expects promises to either be resolved or rejected.
Is there any plans to implement something like expect(promise).to.eventually.be.pending?
I need to test a promise that should be in a pending state at the moment of the test. I was able to test it doing:
expect(promise).to.eventually.not.be.fulfilled
this expect throws the expected error but it isnt bound to the mochas context so if it fails it won't be reported as a failed test. If I
return
it orawait
, the statement will block for 2s and mocha will fail with a timeout, because mocha expects promises to either be resolved or rejected.Is there any plans to implement something like
expect(promise).to.eventually.be.pending
?