diff --git a/Userland/Libraries/LibJS/Tests/test-common.js b/Userland/Libraries/LibJS/Tests/test-common.js index 5251cf79af..1ecfa8c0b6 100644 --- a/Userland/Libraries/LibJS/Tests/test-common.js +++ b/Userland/Libraries/LibJS/Tests/test-common.js @@ -214,24 +214,26 @@ class ExpectationError extends Error { }); } - toBeTrue() { + toBeTrue(customDetails = undefined) { this.__doMatcher(() => { this.__expect( this.target === true, () => - `toBeTrue: expected target to be true, got _${valueToString(this.target)}_` + `toBeTrue: expected target to be true, got _${valueToString(this.target)}_${ + customDetails ? ` (${customDetails})` : "" + }` ); }); } - toBeFalse() { + toBeFalse(customDetails = undefined) { this.__doMatcher(() => { this.__expect( this.target === false, () => `toBeFalse: expected target to be false, got _${valueToString( this.target - )}_` + )}_${customDetails ?? ""}` ); }); }