mirror of
https://github.com/nvms/prsm.git
synced 2025-12-16 08:00:53 +00:00
18 lines
481 B
TypeScript
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 }]);
|
|
});
|
|
});
|
|
});
|