chai-immutable
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -38,3 +38,2 @@ { | ||
"requirePaddingNewLinesBeforeExport": true, | ||
"requirePaddingNewLinesBeforeLineComments": true, | ||
"requireParenthesesAroundIIFE": true, | ||
@@ -41,0 +40,0 @@ "requireSemicolons": true, |
@@ -419,2 +419,3 @@ 'use strict'; | ||
var assert = chai.assert; | ||
var originalEqual = assert.equal; | ||
@@ -441,6 +442,9 @@ /** | ||
assert.equal = function (actual, expected) { | ||
// It seems like we shouldn't actually need this check, however, | ||
// `assert.equal` actually behaves differently than its BDD counterpart! | ||
// Namely, the BDD version is strict while the "assert" one isn't. | ||
if (actual instanceof Collection) { | ||
return new Assertion(actual).equal(expected); | ||
} | ||
else return assert.equal; | ||
else return originalEqual(actual, expected); | ||
}; | ||
@@ -447,0 +451,0 @@ |
{ | ||
"name": "chai-immutable", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Chai assertions for Facebook's Immutable library for JavaScript collections", | ||
@@ -5,0 +5,0 @@ "main": "chai-immutable.js", |
@@ -36,2 +36,10 @@ 'use strict'; | ||
describe('equal method', function () { | ||
it( | ||
'should fail when only the "expected" value is an Immutable collection', | ||
function () { | ||
var fn = function () { expect([]).to.equal(List()); }; | ||
expect(fn).to.throw(Error); | ||
} | ||
); | ||
it('should be true when compared structure is equal', function () { | ||
@@ -301,2 +309,10 @@ expect(list3).to.equal(List.of(1, 2, 3)); | ||
describe('equal assertion', function () { | ||
it( | ||
'should fail when only the "expected" value is an Immutable collection', | ||
function () { | ||
var fn = function () { assert.equal([], List()); }; | ||
assert.throw(fn); | ||
} | ||
); | ||
it('should be true when compared structure is equal', function () { | ||
@@ -303,0 +319,0 @@ assert.equal(list3, List.of(1, 2, 3)); |
Sorry, the diff of this file is not supported yet
37202
764