-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.test.ts
More file actions
29 lines (24 loc) · 980 Bytes
/
basic.test.ts
File metadata and controls
29 lines (24 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { testSuite, expect } from "manten";
import { nrml, testCollection } from "../../common";
export default testSuite(async ({ describe }) => {
describe("insert", ({ test }) => {
test("insert one", () => {
const collection = testCollection();
collection.insert({ foo: "bar" });
const found = nrml(collection.find({ foo: "bar" }));
expect(found).toEqual([{ foo: "bar" }]);
});
test("insert multiple", () => {
const collection = testCollection();
collection.insert([{ foo: "bar" }, { foo: "baz" }, { foo: "boo" }]);
const found = nrml(collection.find({ foo: { $includes: "b" } }));
expect(found).toEqual([{ foo: "bar" }, { foo: "baz" }, { foo: "boo" }]);
});
test("can insert emojis", () => {
const collection = testCollection();
collection.insert({ foo: "👍" });
const found = nrml(collection.find({ foo: "👍" }));
expect(found).toEqual([{ foo: "👍" }]);
});
});
});