chai-as-promised icon indicating copy to clipboard operation
chai-as-promised copied to clipboard

Implementation of to.eventually.be.pending

Open dhulke opened this issue 4 years ago • 0 comments

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?

dhulke avatar Jun 24 '20 02:06 dhulke