mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +00:00
LibJS: Convert most builtin tests to new system
This commit is contained in:
parent
46581773c1
commit
3f97d75778
107 changed files with 2031 additions and 2243 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue