Closed meta72 closed 4 months ago
as far as i can tell, i think this is expected behaviour
basically, when you want to assert against the eventual value, you would use eventually
.
when you want to assert that it resolved or rejected, you would not. similarly, if you want to assert that it rejected with a particular value, you wouldn't use eventually
.
examples:
// for all of these, we're asserting on the state of the promise.
// not on the eventual value
expect(val).to.be.rejected;
expect(val).not.to.be.rejected;
expect(val).to.be.rejectedWith(Error);
// but for this we want to assert against the eventual value
expect(val).to.eventually.equal(123);
Setup
Test Suite
Similar assertions that work as expected
```typescript describe("assertions that work as expected", function(): void { it("should succeed expecting rejected Promise to be rejected", function(): PromiseLikeI would have expected that the first test case, i.e. asserting that a rejected promise will not be rejected, should fail. Is this a bug, or did I miss something with negating assertions with
eventually
?