Skip to content

Commit

Permalink
refactor: extract test_kv function
Browse files Browse the repository at this point in the history
  • Loading branch information
bob2402 committed Apr 7, 2024
1 parent 7c2d3da commit 322709b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ import {
} from "./_libs.ts";
import { not_modifiable_information } from "./resolvers/nip11.ts";

const test_kv = async () => await Deno.openKv("test.sqlite");

Deno.test("main", async (t) => {
const test_kv = async () => {
try {
await Deno.remove("test.sqlite");
} catch (e) {}
return await Deno.openKv("test.sqlite");
};

Deno.test("main", async (t) => {
const relay = await run({
password: "123",
port: 8080,
Expand Down Expand Up @@ -134,9 +136,6 @@ Deno.test("main", async (t) => {

// https://github.com/nostr-protocol/nips/blob/master/11.md
Deno.test("NIP-11: Relay Information Document", async (t) => {
try {
await Deno.remove("test.sqlite");
} catch (e) {}
const relay = await run({
password: "123",
port: 8080,
Expand Down

0 comments on commit 322709b

Please sign in to comment.