aboutsummaryrefslogtreecommitdiff
path: root/src/routes.test.ts
diff options
context:
space:
mode:
authorKevin J Hoerr <kjhoerr@protonmail.com>2021-09-17 12:25:32 -0400
committerKevin J Hoerr <kjhoerr@protonmail.com>2021-09-17 12:25:32 -0400
commitcca92e4ba601b4a738807224b4abe53228bab1a0 (patch)
treead34fcdacbe981b6c7b35ba9fb1717242edfeef5 /src/routes.test.ts
parente33d446ee8457f8ae114e33210382668efba92a9 (diff)
downloadao-coverage-cca92e4ba601b4a738807224b4abe53228bab1a0.tar.gz
ao-coverage-cca92e4ba601b4a738807224b4abe53228bab1a0.tar.bz2
ao-coverage-cca92e4ba601b4a738807224b4abe53228bab1a0.zip
#14 Changed /bash file to /sh
Diffstat (limited to 'src/routes.test.ts')
-rw-r--r--src/routes.test.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/routes.test.ts b/src/routes.test.ts
index 5ffd289..d761602 100644
--- a/src/routes.test.ts
+++ b/src/routes.test.ts
@@ -88,21 +88,21 @@ const HOST_DIR = configOrError("HOST_DIR");
const TARGET_URL = process.env.TARGET_URL ?? "http://localhost:3000";
describe("templates", () => {
- describe("GET /bash", () => {
- it("should return the bash file containing the curl command", async () => {
+ describe("GET /sh", () => {
+ it("should return the sh file containing the curl command", async () => {
await persistTemplate({
inputFile: path.join(
__dirname,
"..",
"public",
"templates",
- "bash.template"
+ "sh.template"
),
- outputFile: path.join(HOST_DIR, "bash"),
+ outputFile: path.join(HOST_DIR, "sh"),
context: { TARGET_URL }
} as Template);
- const res = await (await request()).get("/bash").expect(200);
+ const res = await (await request()).get("/sh").expect(200);
expect(exit).not.toHaveBeenCalled();
expect(res.text).toMatch("curl -X POST");
expect(res.text).toMatch(`url="${TARGET_URL}"`);
@@ -128,7 +128,9 @@ describe("templates", () => {
.expect("Content-Type", /html/)
.expect(200);
expect(exit).not.toHaveBeenCalled();
- expect(res.text).toMatch(`bash &lt;(curl -s ${TARGET_URL}/bash)`);
+ expect(res.text).toMatch(
+ `curl --proto '=https' --tlsv1.2 -sSf ${TARGET_URL}/sh | sh`
+ );
});
});
});