Permalink
Browse files

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

  • Loading branch information...
1 parent 50ac073 commit 35961182f97b08b2970ceca7cac7cbbefcd6b320 @jfirebaugh jfirebaugh committed Dec 27, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 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

0 comments on commit 3596118

Please sign in to comment.