1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

LibJS: Add assertThrowsError() test function

This commit is contained in:
Linus Groh 2020-04-19 23:01:45 +01:00 committed by Andreas Kling
parent c5730ed6a3
commit 0718f216af
10 changed files with 112 additions and 118 deletions

View file

@ -26,12 +26,11 @@ try {
assert(d.writable === true);
assert(d.value === "ho");
try {
assertThrowsError(() => {
Object.defineProperty(o, "bar", { value: "xx", enumerable: false });
assertNotReached();
} catch (e) {
assert(e.name === "TypeError");
}
}, {
error: TypeError
});
Object.defineProperty(o, "baz", { value: 9, configurable: true, writable: false });
Object.defineProperty(o, "baz", { configurable: true, writable: true });