Skip to content
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

Add support for chai-as-promised #32

Closed
jakubzitny opened this issue Nov 23, 2015 · 4 comments
Closed

Add support for chai-as-promised #32

jakubzitny opened this issue Nov 23, 2015 · 4 comments
Labels

Comments

@jakubzitny
Copy link
Contributor

I have some promises returning collections from immutable.js.
It'd be nice to expect the promised values with chai-as-promised.

Something like:

expect(Promise.resolve(immutable.List())).to.eventually.be.empty
@astorije
Copy link
Owner

Hey @jakubzitny, thanks for bringing that up!

As a matter of fact, I have used chai-immutable with chai-as-promised before. Look at this test for example. Note however that this relies on chai-as-promised being loaded after chai-immutable (or any other plugins you want to "promisify", for that matter), as shown at the beginning.

Could you confirm this answers your issue? Do you see anything we can add to chai-immutable in this regard?

@jakubzitny
Copy link
Contributor Author

Hi, thanks for the reply :)

It really works when I load chai-as-promised at the end, great. Actually I did think about this but somehow I forgot to try loading it like this. Maybe it would help to mention it in the Installation part of README. Also some examples of chai-immutable with other plugins could be helpful.

@astorije
Copy link
Owner

Thanks @jakubzitny, I'll add a mention about loading chai-immutable before chai-as-promised in the README of this project, although I believe this has more its place in the README of chai-as-promised.

I won't come up with examples of using with other plugins as I'm not using any myself, but I'd be happy to discuss such examples here before adding them to the README :-)

@astorije
Copy link
Owner

I have added a paragraph in the doc and submitted it as a PR (#38) so that you can tell me what you think before merging it. See you there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants