From 476e4ed03c038a4c9306cf96045017464f2dbdf8 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Sat, 1 Jul 2023 09:24:15 +0200 Subject: fix(ext/kv): expose Deno.AtomicOperation (#19674) --- cli/tests/unit/kv_test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cli/tests/unit') 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) { +function dbTest(name: string, fn: (db: Deno.Kv) => Promise | void) { Deno.test({ name, // https://github.com/denoland/deno/issues/18363 @@ -58,7 +58,7 @@ function dbTest(name: string, fn: (db: Deno.Kv) => Promise) { 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); +}); -- cgit v1.2.3