Skip to content

Commit 5fe5b14

Browse files
committed
chore: add test case for when mocking has been setup
1 parent 19a2316 commit 5fe5b14

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/routes/v1_versions.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,20 @@ describe("v1_versions", () => {
6565
expect(Array.isArray(data)).toBe(true);
6666
expect(data.every((version) => !version.draft)).toBe(true);
6767
});
68+
69+
it.todo("should return 404 when no draft versions are available", async () => {
70+
const request = new Request("https://api.mojis.dev/api/v1/versions/draft");
71+
const ctx = createExecutionContext();
72+
const response = await worker.fetch(request, env, ctx);
73+
await waitOnExecutionContext(ctx);
74+
75+
expect(response.status).toBe(404);
76+
const data = await response.json();
77+
expect(data).toMatchObject({
78+
message: expect.any(String),
79+
status: 404,
80+
path: "/api/v1/versions/draft",
81+
timestamp: expect.any(String),
82+
});
83+
});
6884
});

0 commit comments

Comments
 (0)