1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +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,14 +1,9 @@
load("test-common.js");
test("basic functionality", () => {
expect(Math.min).toHaveLength(2);
try {
assert(Math.min.length === 2);
assert(Math.min(1) === 1);
assert(Math.min(2, 1) === 1);
assert(Math.min(1, 2, 3) === 1);
assert(isNaN(Math.min(NaN)));
assert(isNaN(Math.min("String", 1)));
console.log("PASS");
} catch {
console.log("FAIL");
}
expect(Math.min(1)).toBe(1);
expect(Math.min(2, 1)).toBe(1);
expect(Math.min(1, 2, 3)).toBe(1);
expect(Math.min(NaN)).toBeNaN();
expect(Math.min("String", 1)).toBeNaN();
});