Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support inspect with 0 depth #23

Merged
merged 1 commit into from

2 participants

@Mange

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.

@Mange Mange 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.
85e40bc
@jfirebaugh jfirebaugh merged commit b742900 into chaijs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 22, 2012
  1. @Mange

    Support inspect with 0 depth

    Mange authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  chai-jquery.js
View
2  chai-jquery.js
@@ -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();
Something went wrong with that request. Please try again.