Permalink
Browse files

Support inspect with 0 depth

I usually want to inspect with depth 0 when I'm asserting
things on elements. Sadly, JavaScript is loosly typed so 0
is considered falsy.
  • Loading branch information...
1 parent 857cf4b commit 85e40bc4a2433dec1170db837163c4fe86878717 @Mange Mange committed Nov 22, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 chai-jquery.js
View
@@ -18,7 +18,7 @@
jQuery.fn.inspect = function (depth) {
var el = jQuery('<div />').append(this.clone());
- if (depth) {
+ if (depth !== undefined) {
var children = el.children();
while (depth-- > 0)
children = children.children();

0 comments on commit 85e40bc

Please sign in to comment.