From: Lady Date: Sat, 22 Jul 2023 06:52:19 +0000 (-0700) Subject: Use strict asserts in value.test.js X-Git-Url: https://git.ladys.computer/Pisces/commitdiff_plain/c5be14374b85e5fb2f4958d9f1613ee652f505f5?hp=bf3fe705a9d5f717b3c1794a12726e926ece7ecc Use strict asserts in value.test.js --- diff --git a/value.test.js b/value.test.js index df86778..747b18e 100644 --- a/value.test.js +++ b/value.test.js @@ -8,7 +8,6 @@ // file, You can obtain one at . import { - assert, assertStrictEquals, assertThrows, describe, @@ -206,79 +205,82 @@ describe("ordinaryToPrimitive", () => { describe("sameValue", () => { it("[[Call]] returns false for null 🆚 undefined", () => { - assert(!sameValue(null, void {})); + assertStrictEquals(sameValue(null, undefined), false); }); it("[[Call]] returns false for null 🆚 an object", () => { - assert(!sameValue(null, {})); + assertStrictEquals(sameValue(null, {}), false); }); it("[[Call]] returns true for null 🆚 null", () => { - assert(sameValue(null, null)); + assertStrictEquals(sameValue(null, null), true); }); it("[[Call]] returns false for two different objects", () => { - assert(!sameValue({}, {})); + assertStrictEquals(sameValue({}, {}), false); }); it("[[Call]] returns true for the same object", () => { const obj = {}; - assert(sameValue(obj, obj)); + assertStrictEquals(sameValue(obj, obj), true); }); it("[[Call]] returns false for ±0", () => { - assert(!sameValue(0, -0)); + assertStrictEquals(sameValue(0, -0), false); }); it("[[Call]] returns true for -0", () => { - assert(sameValue(-0, -0)); + assertStrictEquals(sameValue(-0, -0), true); }); it("[[Call]] returns true for nan", () => { - assert(sameValue(0 / 0, 0 / 0)); + assertStrictEquals(sameValue(0 / 0, 0 / 0), true); }); it("[[Call]] returns false for a primitive and its wrapped object", () => { - assert(!sameValue(false, new Boolean(false))); + assertStrictEquals(sameValue(false, new Boolean(false)), false); }); }); describe("sameValueZero", () => { it("[[Call]] returns false for null 🆚 undefined", () => { - assert(!sameValueZero(null, void {})); + assertStrictEquals(sameValueZero(null, undefined), false); }); it("[[Call]] returns false for null 🆚 an object", () => { - assert(!sameValueZero(null, {})); + assertStrictEquals(sameValueZero(null, {}), false); }); it("[[Call]] returns true for null 🆚 null", () => { - assert(sameValueZero(null, null)); + assertStrictEquals(sameValueZero(null, null), true); }); it("[[Call]] returns false for two different objects", () => { - assert(!sameValueZero({}, {})); + assertStrictEquals(sameValueZero({}, {}), false); }); it("[[Call]] returns true for the same object", () => { const obj = {}; - assert(sameValueZero(obj, obj)); + assertStrictEquals(sameValueZero(obj, obj), true); }); it("[[Call]] returns true for ±0", () => { - assert(sameValueZero(0, -0)); + assertStrictEquals(sameValueZero(0, -0), true); }); it("[[Call]] returns true for -0", () => { - assert(sameValueZero(-0, -0)); + assertStrictEquals(sameValueZero(-0, -0), true); }); it("[[Call]] returns true for nan", () => { - assert(sameValueZero(0 / 0, 0 / 0)); + assertStrictEquals(sameValueZero(0 / 0, 0 / 0), true); }); it("[[Call]] returns false for a primitive and its wrapped object", () => { - assert(!sameValueZero(false, new Boolean(false))); + assertStrictEquals( + sameValueZero(false, new Boolean(false)), + false, + ); }); });