mirror of
https://github.com/nvms/prsm.git
synced 2025-12-16 08:00:53 +00:00
18 lines
647 B
TypeScript
18 lines
647 B
TypeScript
import { testSuite, expect } from "manten";
|
|
import { nrml, testCollection } from "../../../common";
|
|
|
|
export default testSuite(async ({ describe }) => {
|
|
describe("$length", ({ test }) => {
|
|
test("works", () => {
|
|
const collection = testCollection();
|
|
collection.insert({ foo: [0, 0] });
|
|
collection.insert({ foo: [0, 0, 0] });
|
|
collection.insert({ foo: [0, 0, 0] });
|
|
collection.insert({ foo: "abc" });
|
|
collection.insert({ foo: "abcd" });
|
|
const found = nrml(collection.find({ foo: { $length: 3 } }));
|
|
expect(found).toEqual([{ foo: [0, 0, 0] }, { foo: [0, 0, 0] }, { foo: "abc" }]);
|
|
});
|
|
});
|
|
});
|