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

to.have.length() for non-zero length #58

Open
ELLIOTTCABLE opened this issue May 26, 2013 · 1 comment
Open

to.have.length() for non-zero length #58

ELLIOTTCABLE opened this issue May 26, 2013 · 1 comment

Comments

@ELLIOTTCABLE
Copy link

I would expect length() to be able to check for any non-zero-length. The cleanest API for this, to me, would be passing no argument:

expect(filled_array).to.have.length()

Also, more powerfully, it'd be nice to be able to chain the numeric operators onto this:

expect(filled_array).to.have.length.greaterThan(2)
@skeggse
Copy link

skeggse commented Dec 19, 2013

The first API is pretty nice, I'd go for that. The second I'm not so sure about, given how Expect.js works internally. It would require a fairly major restructuring of the codebase, and wouldn't add a whole lot.

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

No branches or pull requests

2 participants