mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
LibJS: Print the expected and received value on expect.toEqual() failure
'ExpectationError' is hardly an actionable error message.
This commit is contained in:
parent
6bb0c09bc1
commit
0fe97cdfe4
1 changed files with 7 additions and 1 deletions
|
@ -280,7 +280,13 @@ class ExpectationError extends Error {
|
||||||
|
|
||||||
toEqual(value) {
|
toEqual(value) {
|
||||||
this.__doMatcher(() => {
|
this.__doMatcher(() => {
|
||||||
this.__expect(deepEquals(this.target, value));
|
this.__expect(
|
||||||
|
deepEquals(this.target, value),
|
||||||
|
() =>
|
||||||
|
`Expected _${valueToString(value)}_, but got _${valueToString(
|
||||||
|
this.target
|
||||||
|
)}_`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue