diff --git a/Userland/Libraries/LibJS/Tests/test-common.js b/Userland/Libraries/LibJS/Tests/test-common.js index bbdc80fc9b..3f5e51d24b 100644 --- a/Userland/Libraries/LibJS/Tests/test-common.js +++ b/Userland/Libraries/LibJS/Tests/test-common.js @@ -512,7 +512,8 @@ class ExpectationError extends Error { __expect(value, details) { if (value !== true) { if (details !== undefined) { - throw new ExpectationError(details()); + if (details instanceof Function) throw new ExpectationError(details()); + else throw new ExpectationError(details); } else { throw new ExpectationError(); }