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:
parent
c5730ed6a3
commit
0718f216af
10 changed files with 112 additions and 118 deletions
|
@ -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 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue