aboutsummaryrefslogtreecommitdiff
path: root/src/routes.test.ts
diff options
context:
space:
mode:
authorKevin J Hoerr <kjhoerr@protonmail.com>2022-04-04 01:17:50 +0000
committerKevin J Hoerr <kjhoerr@protonmail.com>2022-04-04 01:17:50 +0000
commit97b0a2cafc7c32d264fb3317e8a5ddaea61978a3 (patch)
tree269c93c8c84a59d36cf41b5ec82b3ecb1682176d /src/routes.test.ts
parenta87eb1608d354a6e9c8170e0fdc432a5f556c445 (diff)
downloadao-coverage-97b0a2cafc7c32d264fb3317e8a5ddaea61978a3.tar.gz
ao-coverage-97b0a2cafc7c32d264fb3317e8a5ddaea61978a3.tar.bz2
ao-coverage-97b0a2cafc7c32d264fb3317e8a5ddaea61978a3.zip
Formatting and linting fixes
Diffstat (limited to 'src/routes.test.ts')
-rw-r--r--src/routes.test.ts44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/routes.test.ts b/src/routes.test.ts
index 5d7839c..2633308 100644
--- a/src/routes.test.ts
+++ b/src/routes.test.ts
@@ -124,11 +124,20 @@ const TARGET_URL = "https://localhost:3000";
describe("templates", () => {
describe("GET /sh", () => {
it("should return the sh file containing the curl command", async () => {
- await persistTemplate({
- inputFile: path.join(__dirname, "..", "public", "templates", "sh.tmpl"),
- outputFile: path.join(HOST_DIR, "sh"),
- context: { TARGET_URL },
- } as Template, logger);
+ await persistTemplate(
+ {
+ inputFile: path.join(
+ __dirname,
+ "..",
+ "public",
+ "templates",
+ "sh.tmpl"
+ ),
+ outputFile: path.join(HOST_DIR, "sh"),
+ context: { TARGET_URL },
+ } as Template,
+ logger
+ );
const res = await (await request()).get("/sh").expect(200);
expect(exit).not.toHaveBeenCalled();
@@ -139,17 +148,20 @@ describe("templates", () => {
describe("GET /", () => {
it("should return the index HTML file containing the bash command", async () => {
- await persistTemplate({
- inputFile: path.join(
- __dirname,
- "..",
- "public",
- "templates",
- "index.html.tmpl"
- ),
- outputFile: path.join(HOST_DIR, "index.html"),
- context: { TARGET_URL, CURL_HTTPS: "--https " },
- } as Template, logger);
+ await persistTemplate(
+ {
+ inputFile: path.join(
+ __dirname,
+ "..",
+ "public",
+ "templates",
+ "index.html.tmpl"
+ ),
+ outputFile: path.join(HOST_DIR, "index.html"),
+ context: { TARGET_URL, CURL_HTTPS: "--https " },
+ } as Template,
+ logger
+ );
const res = await (await request())
.get("/")