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

Length instead of count? #7

Open
hazeledmands opened this issue Jan 28, 2014 · 4 comments
Open

Length instead of count? #7

hazeledmands opened this issue Jan 28, 2014 · 4 comments

Comments

@hazeledmands
Copy link
Contributor

Chai uses length instead of count for arrays, it might be good if we the same thing for collections of elements.

Unfortunately we can't do this with chai 1.8.1, we need to wait until the changes in chaijs/chai#219 get published so we can use overwriteChainableMethod (length is a chainable method).

@hazeledmands
Copy link
Contributor Author

...and chaijs 1.9.0 is out! Now this is an actual todo.

@alexgorbatchev
Copy link

Either feel weird.. dom.to.have.length or dom.to.have.count... how about dom.to.have.many() ? It could also default to be > 1

@hazeledmands
Copy link
Contributor Author

How about occur, for example:

  • expect('li').dom.to.occur(3).times?
  • expect('li').dom.to.occur.at.most(3).times?

@alexgorbatchev
Copy link

dig it!

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

2 participants