mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +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,21 +0,0 @@
|
|||
load("test-common.js");
|
||||
|
||||
try {
|
||||
var nan = undefined + 1;
|
||||
assert(nan + "" == "NaN");
|
||||
assert(NaN + "" == "NaN");
|
||||
assert(nan !== nan);
|
||||
assert(NaN !== NaN);
|
||||
assert(isNaN(nan) === true);
|
||||
assert(isNaN(NaN) === true);
|
||||
assert(isNaN(0) === false);
|
||||
assert(isNaN(undefined) === true);
|
||||
assert(isNaN(null) === false);
|
||||
assert(isNaN(Infinity) === false);
|
||||
assert(!!NaN === false);
|
||||
assert(!!nan === false);
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
13
Libraries/LibJS/Tests/builtins/NaN/NaN.js
Normal file
13
Libraries/LibJS/Tests/builtins/NaN/NaN.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
test("basic functionality", () => {
|
||||
const nan = undefined + 1;
|
||||
|
||||
expect(nan + "").toBe("NaN");
|
||||
expect(NaN + "").toBe("NaN");
|
||||
expect(nan !== nan).toBeTrue();
|
||||
expect(NaN !== NaN).toBeTrue();
|
||||
expect(nan).toBeNaN();
|
||||
expect(NaN).toBeNaN();
|
||||
expect(0).not.toBeNaN();
|
||||
expect(!!nan).toBeFalse();
|
||||
expect(!!NaN).toBeFalse();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue