2

I'm using Chai for my test and I want to deep compare the returned object from a promise.

I tried this approach:

expect(promise).to.eventually.eql(object)
expect(promise).deep.equals(object)
expect(promise).should.eventually.equal(object)

But it does not work. I checked many other samples but none of them works. This is what I'm getting:

AssertionError: Unspecified AssertionError

Does anyone experienced something similar?

(By the way, the "object" contains an array of objects...)

Badacadabra
  • 8,043
  • 7
  • 28
  • 49
Charlires
  • 863
  • 1
  • 11
  • 30

1 Answers1

6

You can simply combine the eventually(which is from chai-as-promised?) and the deep.

expect(promise).to.eventually.deep.equal(object)
user1777136
  • 1,746
  • 14
  • 28