From db98bd69e66ae7934cd123e2a0d0da0e97503311 Mon Sep 17 00:00:00 2001 From: domenic Date: Sun, 27 May 2012 17:31:06 -0400 Subject: [PATCH] Fix .not.deep.equal. It wasn't passing the negation through. --- lib/assertion.js | 2 +- test/expect.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/assertion.js b/lib/assertion.js index b1c9b8c3f..83098981d 100644 --- a/lib/assertion.js +++ b/lib/assertion.js @@ -514,7 +514,7 @@ Object.defineProperty(Assertion.prototype, 'arguments', Assertion.prototype.equal = function (val) { var obj = flag(this, 'object'); if (flag(this, 'deep')) { - new Assertion(obj).to.eql(val); + return this.eql(val); } else { this.assert( val === obj diff --git a/test/expect.js b/test/expect.js index e5054a62a..fd3bbec3b 100644 --- a/test/expect.js +++ b/test/expect.js @@ -230,6 +230,7 @@ suite('expect', function () { test('deep.equal(val)', function(){ expect({ foo: 'bar' }).to.deep.equal({ foo: 'bar' }); + expect({ foo: 'bar' }).not.to.deep.equal({ foo: 'baz' }); }); test('empty', function(){