mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 07:38:10 +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) {
|
||||
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