1
0
Files
sashinexists/node_modules/@weborigami/async-tree/test/operations/take.test.js
2024-12-07 13:18:31 +11:00

21 lines
477 B
JavaScript

import assert from "node:assert";
import { describe, test } from "node:test";
import { Tree } from "../../src/internal.js";
import take from "../../src/operations/take.js";
describe("take", () => {
test("limits the number of keys to the indicated count", async () => {
const tree = {
a: 1,
b: 2,
c: 3,
d: 4,
};
const result = await take(tree, 2);
assert.deepEqual(await Tree.plain(result), {
a: 1,
b: 2,
});
});
});