Skip to content

Commit

Permalink
Merge pull request #512 from dereke/master
Browse files Browse the repository at this point in the history
fixed expect('').to.contain('') so it passes
  • Loading branch information
keithamus committed Sep 11, 2015
2 parents 5044dc0 + eaba0be commit cf9f5d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chai/core/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ module.exports = function (chai, _) {
for (var k in val) subset[k] = obj[k];
expected = _.eql(subset, val);
} else {
expected = obj && ~obj.indexOf(val);
expected = (obj != undefined) && ~obj.indexOf(val);
}
this.assert(
expected
Expand Down
1 change: 1 addition & 0 deletions test/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ describe('assert', function () {

it('include', function() {
assert.include('foobar', 'bar');
assert.include('', '');
assert.include([ 1, 2, 3], 3);
assert.include({a:1, b:2}, {b:2});

Expand Down

0 comments on commit cf9f5d9

Please sign in to comment.