mjackson / expect

Write better assertions
MIT License
2.29k stars 117 forks source link

Expected {} to equal {} #225

Open IonicaBizau opened 7 years ago

IonicaBizau commented 7 years ago
> expect(Object.create(null)).toEqual({})
Error: Expected {} to equal {}

They are different, because of prototype, but the output is weird.

ljharb commented 7 years ago

It might be worth special-casing objects whose [[Prototype]] isn't Object.prototype in the debug output.

If that's managed by object-inspect, please file an issue there for it (I don't recall if this project uses it or not)