-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
83 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
import { assert } from "jsr:@std/assert@0.225/assert"; | ||
export { concat } from "jsr:@std/bytes@0.224/concat"; | ||
export { delay } from "jsr:@std/async@0.224/delay"; | ||
export { assert } from "jsr:@std/assert@0.225/assert"; | ||
export { assertEquals } from "jsr:@std/assert@0.225/assert-equals"; | ||
export { assertNotEquals } from "jsr:@std/assert@0.225/assert-not-equals"; | ||
export { assertRejects } from "jsr:@std/assert@0.225/assert-rejects"; | ||
export { assertStrictEquals } from "jsr:@std/assert@0.225/assert-strict-equals"; | ||
export { timingSafeEqual } from "jsr:@std/crypto@0.224/timing-safe-equal"; | ||
import { assert } from "jsr:@std/assert@~1/assert"; | ||
export { concat } from "jsr:@std/bytes@~1/concat"; | ||
export { delay } from "jsr:@std/async@~1/delay"; | ||
export { assert } from "jsr:@std/assert@~1/assert"; | ||
export { assertEquals } from "jsr:@std/assert@~1/equals"; | ||
export { assertNotEquals } from "jsr:@std/assert@~1/not-equals"; | ||
export { assertRejects } from "jsr:@std/assert@~1/rejects"; | ||
export { assertStrictEquals } from "jsr:@std/assert@~1/strict-equals"; | ||
export { timingSafeEqual } from "jsr:@std/crypto@~1/timing-safe-equal"; | ||
|
||
let kv: Deno.Kv | undefined; | ||
let kv: { close(): void } | undefined; | ||
let path: string | undefined; | ||
|
||
export async function setup(): Promise<Deno.Kv> { | ||
path = `${await Deno.makeTempDir()}/test.db`; | ||
return kv = await Deno.openKv(path); | ||
export async function getPath() { | ||
return path = `${await Deno.makeTempDir()}/test.db`; | ||
} | ||
|
||
export async function teardown() { | ||
export async function setup() { | ||
return kv = await Deno.openKv(await getPath()); | ||
} | ||
|
||
export function cleanup() { | ||
assert(path); | ||
return Deno.remove(path); | ||
} | ||
|
||
export function teardown() { | ||
assert(kv); | ||
kv.close(); | ||
assert(path); | ||
await Deno.remove(path); | ||
return cleanup(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.