Skip to content

Empty diff because of .toJSON #1233

@fleg

Description

@fleg

Using deepEqual with object with .toJSON method produce empty diff

Test Source

Example with underscore chain object

var test = require('ava'),
    _ = require('underscore');

test(function(t) {
    t.deepEqual(_([1, 2]).chain(), [1, 2]);
});

Error Message & Stack Trace

$ ava test.js 

  1 failed

  [anonymous]
  test.js:5

   4: test(function(t) {                       
   5:   t.deepEqual(_([1, 2]).chain(), [1, 2]);
   6: });                                      

  Difference:

 
  Test.fn (test.js:5:4)

$ node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
Node.js v4.4.7
linux 4.4.0-59-generic
$ ava --version
0.18.1
$ npm --version
2.15.8

Metadata

Metadata

Assignees

Labels

bugcurrent functionality does not work as desired

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions