build: add jest, tests
This commit is contained in:
15
tests/isDeepWeakEqual.test.ts
Normal file
15
tests/isDeepWeakEqual.test.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { isDeepWeakEqual } from "../src";
|
||||
import { expect, test } from "@jest/globals";
|
||||
|
||||
test("weakly compares objects", () => {
|
||||
expect(isDeepWeakEqual({ a: 1 }, ["lorem"])).toBe(false);
|
||||
|
||||
expect(isDeepWeakEqual({ a: 1 }, { a: 1 })).toBe(true);
|
||||
|
||||
expect(
|
||||
isDeepWeakEqual(
|
||||
{ date: "2024-03-12T18:19:50.548Z" },
|
||||
{ date: new Date(1710267590548) },
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
Reference in New Issue
Block a user