-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d73399e
commit 28b090b
Showing
51 changed files
with
552 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { afterAll, beforeAll, describe, it } from "@std/testing/bdd"; | ||
import { expect } from "@std/expect"; | ||
import { MageTestServer } from "../../test-utils/server.ts"; | ||
|
||
let server: MageTestServer; | ||
|
||
beforeAll(() => { | ||
server = new MageTestServer(); | ||
|
||
server.app.get("/default", (c) => { | ||
c.empty(); | ||
}); | ||
|
||
server.app.get("/set-status", (c) => { | ||
c.empty(205); | ||
}); | ||
|
||
server.start(); | ||
}); | ||
|
||
afterAll(async () => { | ||
await server.stop(); | ||
}); | ||
|
||
describe("responses - empty", () => { | ||
it("should return empty response with default status", async () => { | ||
const response = await fetch(server.url("/default"), { | ||
method: "GET", | ||
}); | ||
|
||
expect(response.status).toBe(204); | ||
expect(await response.text()).toBe(""); | ||
}); | ||
|
||
it("should return empty response with set status", async () => { | ||
const response = await fetch(server.url("/set-status"), { | ||
method: "GET", | ||
}); | ||
|
||
expect(response.status).toBe(205); | ||
expect(await response.text()).toBe(""); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.