1

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...)

4

1 回答 1

5

您可以简单地将eventually(来自chai-as-promised?)和deep.

expect(promise).to.eventually.deep.equal(object)
于 2015-04-10T22:17:24.200 回答