mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibJS/Tests: Add details for toBeTrue() / toBeFalse() expectation error
This commit is contained in:
parent
f28491dbe7
commit
b221cad659
1 changed files with 8 additions and 2 deletions
|
@ -174,13 +174,19 @@ class ExpectationError extends Error {
|
||||||
|
|
||||||
toBeTrue() {
|
toBeTrue() {
|
||||||
this.__doMatcher(() => {
|
this.__doMatcher(() => {
|
||||||
this.__expect(this.target === true);
|
this.__expect(
|
||||||
|
this.target === true,
|
||||||
|
() => `toBeTrue: expected target to be true, got _${String(this.target)}_`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toBeFalse() {
|
toBeFalse() {
|
||||||
this.__doMatcher(() => {
|
this.__doMatcher(() => {
|
||||||
this.__expect(this.target === false);
|
this.__expect(
|
||||||
|
this.target === false,
|
||||||
|
() => `toBeTrue: expected target to be false, got _${String(this.target)}_`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue