Closed igorwojda closed 3 years ago
Did you use shouldBe
or shouldEqual
?
You can try shouldBeEquivalentTo
as it might have the formatting you need.
We could also try to reuse the formatting for Objects that are not found to be equal with shouldBe
or shouldEqual
Tried shouldBeEquivalentTo
, but:
🤔
shouldBeEquivalentTo
doesn't support backtick notation, only pure JVM, as it expects 2 parameters, not only one: an expected
object and config
of EquivalencyAssertionOptions
type.
In other words, this should work fine:
result.shouldBeEquivalentTo(albums)
If my suggestion works, then @MarkusAmshove , could you please close the issue?
I'll interpret igors emoji reaction as "case closed" :-)
While testing complex models it's quite hard to say where the problem lies exactly (which model property does not match expected value):
Now:
If two object are of the same type we could try to display each property in separate line (maybe even add tabs for nested models/properties). Goal here is to instantly know which property does not have expected value:
Expected