From 786e01aca9767e376519d8c8837470d681514d57 Mon Sep 17 00:00:00 2001 From: as490024862-cmd Date: Fri, 5 Jun 2026 01:45:29 +0800 Subject: [PATCH] test: await ky create request --- tests/routes/things/create.test.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/routes/things/create.test.ts b/tests/routes/things/create.test.ts index 65e9935..95b549c 100644 --- a/tests/routes/things/create.test.ts +++ b/tests/routes/things/create.test.ts @@ -4,12 +4,16 @@ import { test, expect } from "bun:test" test("create a thing", async () => { const { ky } = await getTestServer() - ky.post("things/create", { - json: { - name: "Thing1", - description: "Thing1 Description", - }, - }) + const createResult = await ky + .post("things/create", { + json: { + name: "Thing1", + description: "Thing1 Description", + }, + }) + .json<{ ok: boolean }>() + + expect(createResult).toEqual({ ok: true }) const data = await ky .get("things/list")