diff options
author | Luca Casonato <hello@lcas.dev> | 2023-07-01 09:24:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-01 09:24:15 +0200 |
commit | 476e4ed03c038a4c9306cf96045017464f2dbdf8 (patch) | |
tree | be466ba806f0326f8cf2710a68067a1902dfba1b /cli/tests | |
parent | dd508c9c8970fc6565cfd50cd3e01e8571425347 (diff) |
fix(ext/kv): expose Deno.AtomicOperation (#19674)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/kv_test.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/tests/unit/kv_test.ts b/cli/tests/unit/kv_test.ts index 62b53fc55..3081917da 100644 --- a/cli/tests/unit/kv_test.ts +++ b/cli/tests/unit/kv_test.ts @@ -46,7 +46,7 @@ Deno.test({ }, }); -function dbTest(name: string, fn: (db: Deno.Kv) => Promise<void>) { +function dbTest(name: string, fn: (db: Deno.Kv) => Promise<void> | void) { Deno.test({ name, // https://github.com/denoland/deno/issues/18363 @@ -58,7 +58,7 @@ function dbTest(name: string, fn: (db: Deno.Kv) => Promise<void>) { try { await fn(db); } finally { - await db.close(); + db.close(); } }, }); @@ -1750,3 +1750,9 @@ Deno.test({ } }, }); + +dbTest("atomic operation is exposed", (db) => { + assert(Deno.AtomicOperation); + const ao = db.atomic(); + assert(ao instanceof Deno.AtomicOperation); +}); |