-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expect to be rejected with a property #236
Comments
It also doesn't work:
I obtain:
|
It works when I add
Therefore IMO you should improve README because nowhere I can see |
I didn't find that eventually resolved my problem with the following specs
This function passes with
and can be fixed by using await keyword on the expect function!
Now returns:
Not entirely sure why this is the case, I think it might be failing due to the way .to.be.rejected() wraps the function in a Promise. |
Hi, just tested your solution and I can confirm it works, thank you! And I agree with updating the docs :) |
Anyway now you can use |
this works too: expect(Promise.reject).to.be.rejectedWith(Error).eventually.with.property('name', 'YourError') |
The docs are still not updated on this, please update. I had to find this issue to know that adding expect(Promise.reject).to.be.eventually.rejected.with.property('foo', 'bar'); |
it's probably a feature request but I write my environment details because maybe it's a bug
Node version: 8.6.0
npm version: 5.2.0
chai-as-promised version: 7.1.1
chai version: 4.1.2
I have the following code:
Actual behavior:
Expected behavior:
Of cource if the rejected error doesn't have the expected field or its field has another value, it should fail.
The text was updated successfully, but these errors were encountered: