1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 09:28:13 +00:00

LibJS/Tests: Add details for toBeTrue() / toBeFalse() expectation error

This commit is contained in:
Linus Groh 2021-05-13 23:34:03 +01:00
parent f28491dbe7
commit b221cad659

View file

@ -174,13 +174,19 @@ class ExpectationError extends Error {
toBeTrue() {
this.__doMatcher(() => {
this.__expect(this.target === true);
this.__expect(
this.target === true,
() => `toBeTrue: expected target to be true, got _${String(this.target)}_`
);
});
}
toBeFalse() {
this.__doMatcher(() => {
this.__expect(this.target === false);
this.__expect(
this.target === false,
() => `toBeTrue: expected target to be false, got _${String(this.target)}_`
);
});
}