chaijs / chai-as-promised

Extends Chai with assertions about promises.
MIT License
1.42k stars 109 forks source link

Implementation of to.eventually.be.pending #265

Open dhulke opened 4 years ago

dhulke commented 4 years ago

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?