Archived
1
0

Handle undefined body

In the latest Express it seems the body is undefined when no data is
passed (instead of being empty).
This commit is contained in:
Asher
2024-04-16 11:13:36 -08:00
parent 3d8d544f89
commit fb2afbd9d6
4 changed files with 38 additions and 36 deletions

View File

@ -68,13 +68,10 @@ describe("login", () => {
}
})
it("should return HTML with 'Missing password' message", async () => {
it("should return 'Missing password' without body", async () => {
const resp = await codeServer().fetch("/login", { method: "POST" })
expect(resp.status).toBe(200)
const htmlContent = await resp.text()
expect(resp.status).toBe(200)
expect(htmlContent).toContain("Missing password")
})