1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +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,18 +1,14 @@
load("test-common.js");
test("basic functionality", () => {
expect(Math.cos).toHaveLength(1);
try {
assert(Math.cos(0) === 1);
assert(Math.cos(null) === 1);
assert(Math.cos('') === 1);
assert(Math.cos([]) === 1);
assert(Math.cos(Math.PI) === -1);
assert(isNaN(Math.cos()));
assert(isNaN(Math.cos(undefined)));
assert(isNaN(Math.cos([1, 2, 3])));
assert(isNaN(Math.cos({})));
assert(isNaN(Math.cos("foo")));
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}
expect(Math.cos(0)).toBe(1);
expect(Math.cos(null)).toBe(1);
expect(Math.cos('')).toBe(1);
expect(Math.cos([])).toBe(1);
expect(Math.cos(Math.PI)).toBe(-1);
expect(Math.cos()).toBeNaN();
expect(Math.cos(undefined)).toBeNaN();
expect(Math.cos([1, 2, 3])).toBeNaN();
expect(Math.cos({})).toBeNaN();
expect(Math.cos("foo")).toBeNaN();
});