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

assert change asynchronously #428

Closed
timruffles opened this issue Apr 15, 2015 · 2 comments
Closed

assert change asynchronously #428

timruffles opened this issue Apr 15, 2015 · 2 comments

Comments

@timruffles
Copy link
Member

as in [#339] there are two plugins which provide asynchronous change assertions - obviously important for Javascript.

I think it'd be good to integrate one. chai-change is callback based and supports assert and expect. chai-change is promise based and I could only see expect support in the docs.

@keithamus
Copy link
Member

Thanks for the issue @timruffles.

I think the essence of what you're saying is right, but maybe not the full idea...

I think Chai should work more towards supporting primitives, and popular patterns against these - and by this I mean, I would like to see Chai support Promises as a native part of the language, and the callback pattern as a popular primitive pattern. Personally I use chai-as-promised pretty much all of the time, and have extended a hand to @domenic to fold Chai-As-Promised into the chai org (chaijs/chai-as-promised#105 (comment)), with the potential eventuality of supporting it wholesale in Chai.

I have yet to see a really great way to handle callbacks in a similar way, but I'd definitely be excited to see PRs about that.

So ultimately, if Chai supported both Promises and callbacks, the logical extension of this would be to use the same mechanisms to provide useful assertions such as .change.

I would personally rather play the long game on this - while letting plugins like your wonderful chai-change to prop us up in the interim. Make sense?

@vieiralucas
Copy link
Member

vieiralucas commented Apr 22, 2017

Hello @timruffles, I'll be closing this for inactivity

I think this discussion may continue in #605 or #882
If you strongly disagree, please let me know

Thanks

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

No branches or pull requests

3 participants