prsm/packages/arc-degit/tests/specs/from/from.test.ts
2024-08-28 09:08:11 -04:00

18 lines
481 B
TypeScript

import { expect, testSuite } from "manten";
import { Collection } from "../../../src";
import { nrml } from "../../common";
export default testSuite(async ({ describe }) => {
describe("from", ({ test }) => {
test("works", () => {
const data = [
{ a: 1, b: 2, c: 3 },
{ a: 2, b: 2, c: 3 },
];
const c = Collection.from(data);
const found = nrml(c.find({ a: 1 }));
expect(found).toEqual([{ a: 1, b: 2, c: 3 }]);
});
});
});