mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +00:00
LibJS: Allow 'expect().fail("some random string")' in test-js
Previously fail() wanted the fail object to be a callable, allow it to be a string also.
This commit is contained in:
parent
1d95745901
commit
a5958b5f45
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue