Skip to content

Commit

Permalink
fix(kv): assertReject should always be awaited (denoland#19612)
Browse files Browse the repository at this point in the history
  • Loading branch information
losfair committed Jun 27, 2023
1 parent f372688 commit 805c922
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cli/tests/unit/kv_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ dbTest("atomic mutation type=sum wrap around", async (db) => {

dbTest("atomic mutation type=sum wrong type in db", async (db) => {
await db.set(["a"], 1);
assertRejects(
await assertRejects(
async () => {
await db.atomic()
.mutate({ key: ["a"], value: new Deno.KvU64(1n), type: "sum" })
Expand All @@ -456,7 +456,7 @@ dbTest("atomic mutation type=sum wrong type in db", async (db) => {

dbTest("atomic mutation type=sum wrong type in mutation", async (db) => {
await db.set(["a"], new Deno.KvU64(1n));
assertRejects(
await assertRejects(
async () => {
await db.atomic()
// @ts-expect-error wrong type is intentional
Expand Down Expand Up @@ -497,7 +497,7 @@ dbTest("atomic mutation type=min no exists", async (db) => {

dbTest("atomic mutation type=min wrong type in db", async (db) => {
await db.set(["a"], 1);
assertRejects(
await assertRejects(
async () => {
await db.atomic()
.mutate({ key: ["a"], value: new Deno.KvU64(1n), type: "min" })
Expand All @@ -510,7 +510,7 @@ dbTest("atomic mutation type=min wrong type in db", async (db) => {

dbTest("atomic mutation type=min wrong type in mutation", async (db) => {
await db.set(["a"], new Deno.KvU64(1n));
assertRejects(
await assertRejects(
async () => {
await db.atomic()
// @ts-expect-error wrong type is intentional
Expand Down Expand Up @@ -551,7 +551,7 @@ dbTest("atomic mutation type=max no exists", async (db) => {

dbTest("atomic mutation type=max wrong type in db", async (db) => {
await db.set(["a"], 1);
assertRejects(
await assertRejects(
async () => {
await db.atomic()
.mutate({ key: ["a"], value: new Deno.KvU64(1n), type: "max" })
Expand All @@ -564,7 +564,7 @@ dbTest("atomic mutation type=max wrong type in db", async (db) => {

dbTest("atomic mutation type=max wrong type in mutation", async (db) => {
await db.set(["a"], new Deno.KvU64(1n));
assertRejects(
await assertRejects(
async () => {
await db.atomic()
// @ts-expect-error wrong type is intentional
Expand Down Expand Up @@ -1168,7 +1168,7 @@ dbTest("operation size limit", async (db) => {
const res2 = await collect(db.list({ prefix: ["a"] }, { batchSize: 1000 }));
assertEquals(res2.length, 0);

assertRejects(
await assertRejects(
async () => await collect(db.list({ prefix: ["a"] }, { batchSize: 1001 })),
TypeError,
"too many entries (max 1000)",
Expand Down

0 comments on commit 805c922

Please sign in to comment.