-
Notifications
You must be signed in to change notification settings - Fork 20
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
Combining chai-subset and chai-as-promised #69
Comments
To clarify what I'd actually want to achieve, here's an example:
In the original test above I could then remove the I pushed what I would like to have in the end to |
I would also like to combine the two. Right now, I am getting an error saying that myPromise
.should.be.rejected
.and.should.eventually.to.containSubset([{
property1: {
property2: `some value`
}
}]); I get this error only from typescript. At runtime, the code works |
@IonelLupu @bkimminich The way
|
This is kind of a footnote in the
|
Some people seem to miss the note (debitoor/chai-subset#69). It's easy to forget about this too...I only really grokked this behavior after digging into what `chai-as-promise` does under the hood.
I hope to be able to replace some ugly
assertions (which need to specify all the object properties that I don't even care about) with
checks. Unfortunately that does not work, because that
eventually
-thing is a promise with the actual compare value nested inside. This gives me errors like:Using
to.eventually.deep.containSubset
does not work either. You can find the original unit test here: https://github.com/bkimminich/juice-shop-ctf/blob/develop/test/unit/generateData-spec.js#L37-L76Thanks in advance for your help/hints! Btw, merry 🎄 to you!
The text was updated successfully, but these errors were encountered: