Skip to content

Commit 3275dbb

Browse files
committed
Update index.test.ts
1 parent 837583b commit 3275dbb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/cacheable/test/index.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@ describe("cacheable set method", async () => {
184184
const result = await cacheable.getMany(["key1", "key2"]);
185185
expect(result).toEqual(["value1", "value2"]);
186186
});
187+
test("should set many values", async () => {
188+
const cacheable = new Cacheable();
189+
await cacheable.setMany([
190+
{ key: "key1", value: "value1" },
191+
{ key: "key2", value: "value2" },
192+
]);
193+
const result1 = await cacheable.get("key1");
194+
const result2 = await cacheable.get("key2");
195+
expect(result1).toEqual("value1");
196+
expect(result2).toEqual("value2");
197+
});
198+
187199
test("should set value in a non blocking way", async () => {
188200
const secondary = new Keyv();
189201
const cacheable = new Cacheable({ nonBlocking: true, secondary });

0 commit comments

Comments
 (0)