mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +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,16 +1,14 @@
|
|||
load("test-common.js");
|
||||
test("basic functionality", () => {
|
||||
expect(Math.abs).toHaveLength(1);
|
||||
|
||||
try {
|
||||
assert(Math.abs('-1') === 1);
|
||||
assert(Math.abs(-2) === 2);
|
||||
assert(Math.abs(null) === 0);
|
||||
assert(Math.abs('') === 0);
|
||||
assert(Math.abs([]) === 0);
|
||||
assert(Math.abs([2]) === 2);
|
||||
assert(isNaN(Math.abs([1, 2])));
|
||||
assert(isNaN(Math.abs({})));
|
||||
assert(isNaN(Math.abs('string')));
|
||||
assert(isNaN(Math.abs()));
|
||||
console.log("PASS");
|
||||
} catch {
|
||||
}
|
||||
expect(Math.abs('-1')).toBe(1);
|
||||
expect(Math.abs(-2)).toBe(2);
|
||||
expect(Math.abs(null)).toBe(0);
|
||||
expect(Math.abs('')).toBe(0);
|
||||
expect(Math.abs([])).toBe(0);
|
||||
expect(Math.abs([2])).toBe(2);
|
||||
expect(Math.abs([1, 2])).toBeNaN();
|
||||
expect(Math.abs({})).toBeNaN();
|
||||
expect(Math.abs('string')).toBeNaN();
|
||||
expect(Math.abs()).toBeNaN();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue