Skip to content

Commit

Permalink
Fix tests for diff output when comparing objects
Browse files Browse the repository at this point in the history
  • Loading branch information
slobo committed Jan 9, 2017
1 parent 51ef466 commit d206afc
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,16 @@ describe('chai-immutable (' + typeEnv + ')', function () {
it('should display a helpful failure output on big objects', function () {
var actual = new Map({ foo: 'foo foo foo foo foo foo foo foo' });
var expected = new Map({ bar: 'bar bar bar bar bar bar bar bar' });
// AssertionError: expected { Object (foo) } to equal { Object (bar) }
// + expected - actual
//
// {
// - "foo": "foo foo foo foo foo foo foo foo"
// + "bar": "bar bar bar bar bar bar bar bar"
// }
fail(function () {
expect(actual).to.equal(expected);
}, /(foo ?){8}.+(bar ?){8}/);
}, 'AssertionError: expected { Object (foo) } to equal { Object (bar) }');
});

it('should fail given a non-Immutable value', function () {
Expand Down Expand Up @@ -749,9 +756,16 @@ describe('chai-immutable (' + typeEnv + ')', function () {
it('should display a helpful failure output on big objects', function () {
var actual = new Map({ foo: 'foo foo foo foo foo foo foo foo ' });
var expected = new Map({ bar: 'bar bar bar bar bar bar bar bar ' });
// AssertionError: expected { Object (foo) } to equal { Object (bar) }
// + expected - actual
//
// {
// - "foo": "foo foo foo foo foo foo foo foo"
// + "bar": "bar bar bar bar bar bar bar bar"
// }
fail(function () {
assert.equal(actual, expected);
}, /(foo ){8}.+(bar ){8}/);
}, 'AssertionError: expected { Object (foo) } to equal { Object (bar) }');
});

it('should fail given a non-Immutable value', function () {
Expand Down

0 comments on commit d206afc

Please sign in to comment.