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

LibJS: Convert most builtin tests to new system

This commit is contained in:
Matthew Olsson 2020-07-04 10:09:48 -07:00 committed by Andreas Kling
parent 46581773c1
commit 3f97d75778
107 changed files with 2031 additions and 2243 deletions

View file

@ -1,15 +1,10 @@
load("test-common.js");
test("basic functionality", () => {
expect(Math.max).toHaveLength(2);
try {
assert(Math.max.length === 2);
assert(Math.max() === -Infinity);
assert(Math.max(1) === 1);
assert(Math.max(2, 1) === 2);
assert(Math.max(1, 2, 3) === 3);
assert(isNaN(Math.max(NaN)));
assert(isNaN(Math.max("String", 1)));
console.log("PASS");
} catch {
console.log("FAIL");
}
expect(Math.max()).toBe(-Infinity);
expect(Math.max(1)).toBe(1);
expect(Math.max(2, 1)).toBe(2);
expect(Math.max(1, 2, 3)).toBe(3);
expect(Math.max(NaN)).toBeNaN();
expect(Math.max("String", 1)).toBeNaN();
});