updeep/esm/matches.test.js

10 lines
429 B
JavaScript
Raw Normal View History

2025-01-31 17:50:51 +00:00
import { test, expect } from "vitest";
import matches from "./matches.js";
test("basic", () => {
expect(matches(1, 1)).toBeTruthy();
expect(matches(1, 2)).not.toBeTruthy();
expect(matches({ a: 1, b: 2 }, { a: 1 })).toBeTruthy();
expect(matches({ a: 2, b: 2 }, { a: 1 })).not.toBeTruthy();
expect(matches({ 2: { a: (x) => x > 2 } })([1, 1, { a: 3 }])).toBeTruthy();
});
//# sourceMappingURL=matches.test.js.map