Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Note problem with and workaround for length assertions (#21)

  • Loading branch information...
commit 35961182f97b08b2970ceca7cac7cbbefcd6b320 1 parent 50ac073
John Firebaugh jfirebaugh authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 README.md
5 README.md
View
@@ -136,6 +136,11 @@ is not called as a function, the original implementation will be called.
$('body').should.have('h1');
expect($('#content')).to.have('div');
+Note that this assertion has the unfortunate side effect of causing assertions such as
+`expect(selection).to.have.length(2)` to fail. The technical cause is that the `have` property must be a function,
+and functions have a built-in `length` property that cannot be modified. As as workaround, write the assertion
+as `expect(selection).to.be.of.length(2)` instead.
+
## Contributing
To run the test suite, run `npm install` (requires
Please sign in to comment.
Something went wrong with that request. Please try again.