diff options
author | Heyang Zhou <zhy20000919@hotmail.com> | 2023-03-24 20:06:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-24 20:06:27 +0800 |
commit | 94ef428b564f8ba60c2752fb7ca64f804f88baf2 (patch) | |
tree | f18011fc904da78aadd5404046804e152efb6935 /cli/tests/unit/kv_test.ts | |
parent | 275dee60e71225a9c6c4b3b4ea7ffe4c6ecb4d87 (diff) |
fix(ext/kv): add missing `getMany` method (#18410)
The `getMany` method was missing from the implementation of the
`Deno.Kv` class. This patch fixes it.
Diffstat (limited to 'cli/tests/unit/kv_test.ts')
-rw-r--r-- | cli/tests/unit/kv_test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/unit/kv_test.ts b/cli/tests/unit/kv_test.ts index 1c0eed002..fcb0c7894 100644 --- a/cli/tests/unit/kv_test.ts +++ b/cli/tests/unit/kv_test.ts @@ -548,6 +548,16 @@ async function setupData(db: Deno.Kv) { .commit(); } +dbTest("get many", async (db) => { + await setupData(db); + const entries = await db.getMany([["b", "a"], ["a"], ["c"]]); + assertEquals(entries, [ + { key: ["b", "a"], value: 100, versionstamp: "00000000000000010000" }, + { key: ["a"], value: -1, versionstamp: "00000000000000010000" }, + { key: ["c"], value: null, versionstamp: null }, + ]); +}); + dbTest("list prefix", async (db) => { await setupData(db); const entries = await collect(db.list({ prefix: ["a"] })); |