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:
@ -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")
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user