Skip to content

Commit 0272d79

Browse files
Add TODO for e2e. Not sure how to proceed.
1 parent d4b8e56 commit 0272d79

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1+
import { init_tables, init_views, teardown } from "@db/init_tables";
2+
import { test_knexDb } from "@test/test_knexfile";
3+
import app from "@v1/match/router";
14
import type { MatchReport } from "@v1/match/schemas";
25
import { mock_MatchReport } from "@v1/match/test/mock.schemas";
3-
import app from "@v1/match/router";
46
import { Hono } from "hono";
57
import { testClient } from "hono/testing";
6-
import { describe, expect, test } from "vitest";
8+
import { afterEach, beforeEach, describe, expect, test } from "vitest";
9+
710

11+
// TODO: Unsure how to write tests here.
12+
// If e2e tests should not be a superset of tested functionality on integration tests, can we prevent total overlapping?
13+
// How can we inject test_knexDb to the `service.ts` functions while only calling HTTP routes?
814
describe("A user may report a Match", () => {
15+
beforeEach(async () => {
16+
await init_tables(test_knexDb);
17+
await init_views(test_knexDb);
18+
});
19+
afterEach(async () => {
20+
await teardown(test_knexDb);
21+
});
922
test("POST a mock MatchReport", async () => {
1023
const query: MatchReport = mock_MatchReport();
11-
const response = await app.request("/")
24+
const response = await app.request("/");
1225
});
1326
});

0 commit comments

Comments
 (0)