Skip to content

Commit

Permalink
[REM] deno test from gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
maschlr committed Sep 4, 2024
1 parent d2b5ab0 commit b856285
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,3 @@ jobs:

- name: Run linter
run: deno lint

- name: Run tests
run: deno test -A
7 changes: 6 additions & 1 deletion src/storage/kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import {
import { ulid } from "jsr:@std/ulid";
import { Context } from "../../deps.ts";

const kv_ = await Deno.openKv();
let kv_: Deno.Kv;
try {
kv_ = await Deno.openKv();
} catch (e) {
console.error("Failed to open KV store", e);
}

export async function getPlayer(
ctx: Context,
Expand Down
11 changes: 7 additions & 4 deletions tests/kv.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { assertEquals } from "https://deno.land/std@0.192.0/testing/asserts.ts";
import { Game, GameState } from "../models/game.ts";
import { determineScore, listGamesInChat, updateGameRoll } from "./kv.ts";
import { Context } from "../../deps.ts";
import { Player, RollStatus } from "../models/game.ts";
import {
determineScore,
listGamesInChat,
updateGameRoll,
} from "../src/storage/kv.ts";
import { Context } from "../deps.ts";
import { Game, GameState, Player, RollStatus } from "../src/models/game.ts";

Deno.test("determineScore", async (t) => {
await t.step("should return 0-0 for empty rolls", () => {
Expand Down

0 comments on commit b856285

Please sign in to comment.