1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:27:43 +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,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);
}

View 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();
});