mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
LibJS: Convert some top-level tests to the new system
First test conversions! These look really good :)
This commit is contained in:
parent
4b8a3e6d78
commit
eea6041302
22 changed files with 464 additions and 451 deletions
|
@ -1,23 +1,13 @@
|
|||
load("test-common.js");
|
||||
|
||||
try {
|
||||
function foo() { }
|
||||
|
||||
assertThrowsError(() => {
|
||||
test("assignment to function call", () => {
|
||||
expect(() => {
|
||||
function foo() {};
|
||||
foo() = "foo";
|
||||
}, {
|
||||
error: ReferenceError,
|
||||
message: "Invalid left-hand side in assignment"
|
||||
});
|
||||
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
|
||||
});
|
||||
|
||||
assertThrowsError(() => {
|
||||
test("assignment to inline function call", () => {
|
||||
expect(() => {
|
||||
(function () { })() = "foo";
|
||||
}, {
|
||||
error: ReferenceError,
|
||||
message: "Invalid left-hand side in assignment"
|
||||
});
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
||||
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue