Don't test error messages in staging/sm

This commit is contained in:
André Bargull 2025-04-30 14:15:27 +02:00 committed by Ms2ger
parent a709831c8d
commit bbbc23cd41

View File

@ -140,9 +140,8 @@ allow_unused: True
try { try {
thunk(); thunk();
} catch (e) { } catch (e) {
if (e.message.indexOf(substr) !== -1) // Do not test error messages
return; return;
throw new Error("Expected error containing " + substr + ", got " + e);
} }
throw new Error("Expected error containing " + substr + ", no exception thrown"); throw new Error("Expected error containing " + substr + ", no exception thrown");
}; };
@ -157,11 +156,8 @@ allow_unused: True
if (!(exc instanceof ctor)) if (!(exc instanceof ctor))
fullmsg = `Assertion failed: expected exception ${ctor.name}, got ${exc}`; fullmsg = `Assertion failed: expected exception ${ctor.name}, got ${exc}`;
else { else {
var result = check(exc.message); // Do not test error messages
if (!result) return;
fullmsg = `Assertion failed: expected exception with message, got ${exc}`;
else
return;
} }
} }