All files / src/test-routes reserved-words.ts

0% Statements 0/25
0% Branches 0/1
0% Functions 0/8
0% Lines 0/25

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37                                                                         
import { app, ValidationError } from "../api";
 
app.category("vanilla", () => {
  app.put("/reservedWords/operationGroup/import", "reservedWordsOperationGroupImport", (req) => {
    Iif (req.query["parameter1"] === "foo") {
      return { status: 200 };
    }
    return { status: 400 };
  });
 
  app.put("/reservedWords/operation/content", "reservedWordsBodyNamedContent", (req) => {
    req.expect.bodyEquals(Buffer.from("hello, world"));
    return { status: 200 };
  });
  app.put("/reservedWords/operation/json", "reservedWordsBodyNamedJson", (req) => {
    req.expect.bodyEquals({ hello: "world" });
    return { status: 200 };
  });
  app.put("/reservedWords/operation/data", "reservedWordsBodyNamedData", (req) => {
    req.expect.bodyEquals({ data: "hello", world: "world" });
    return { status: 200 };
  });
  app.put("/reservedWords/operation/files", "reservedWordsBodyNamedFiles", (req) => {
    return { status: 200 };
  });
  app.get("/reservedWords/foo", "reservedWordsUrlHeaderQuery", (req) => {
    req.expect.bodyEmpty;
    req.expect.deepEqual(req.query["queryParameters"], ["one", "two"], "Query parameters not equal");
    return { status: 200 };
  });
  app.get("/reservedWords/enum", "reservedWordsHeaderEnum", (req) => {
    req.expect.bodyEmpty;
    req.expect.containsHeader("enumparameter", "import");
    return { status: 200 };
  });
});