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

LibJS: Convert some top-level tests to the new system

First test conversions! These look really good :)
This commit is contained in:
Matthew Olsson 2020-07-03 14:39:25 -07:00 committed by Andreas Kling
parent 4b8a3e6d78
commit eea6041302
22 changed files with 464 additions and 451 deletions

View file

@ -1,12 +1,6 @@
load("test-common.js");
try {
// Note that these will give different results in the REPL due to parsing behavior.
assert([] + [] === "");
assert([] + {} === "[object Object]");
assert({} + {} === "[object Object][object Object]");
assert({} + [] === "[object Object]");
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}
test("adding objects", () => {
expect([] + []).toBe("");
expect([] + {}).toBe("[object Object]");
expect({} + {}).toBe("[object Object][object Object]");
expect({} + []).toBe("[object Object]");
});