Skip to content

Commit

Permalink
Simple test running against local backend
Browse files Browse the repository at this point in the history
  • Loading branch information
sshader committed Mar 12, 2024
1 parent ed1da2a commit fa05a4d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions games.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import { ConvexTestingHelper } from "convex-helpers/testing"
import { api } from "./convex/_generated/api";
describe("games", () => {
let t: ConvexTestingHelper;

beforeEach(() => {
t = new ConvexTestingHelper();
})

afterEach(async () => {
await t.mutation(api.testing.clearAll, {})
await t.close()
})

test("simple", async () => {
expect("Hello world").toStrictEqual("Hello world")
})
const games = await t.query(api.games.ongoingGames, {})
expect(games.length).toStrictEqual(0)
})
})
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module.exports = {
preset: "ts-jest/presets/js-with-ts",
testEnvironment: "node",
transformIgnorePatterns: ['/node_modules/(?!(convex-helpers)/)'],

// Only run one suite at a time because all of our tests are running against
// the same backend and we don't want to leak state.
Expand Down

0 comments on commit fa05a4d

Please sign in to comment.