diff --git a/src/app.test.js b/src/app.test.js index d64aba5..b80e3ce 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -104,10 +104,10 @@ describe("/schedules", () => { candidates: "テスト候補1\r\nテスト候補2\r\nテスト候補3", }); - expect(postRes.headers.get("Location")).toMatch(/schedules/); + const createdSchedulePath = postRes.headers.get("Location"); + expect(createdSchedulePath).toMatch(/schedules/); expect(postRes.status).toBe(302); - const createdSchedulePath = postRes.headers.get("Location"); scheduleId = createdSchedulePath.split("/schedules/")[1]; const res = await app.request(createdSchedulePath);