Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Nov 1, 2023
1 parent 50f0924 commit 5813aa2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions apps/api/tests/validate-environment-variables.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { parseCORSOrigin } from "../src/utils/validate-environment-variables";

describe("parseCORSOrigin", () => {
test("Should remove last / from the CORS origin", () => {
expect(parseCORSOrigin("https://cad.test-cad.example.com/")).toBe(
expect(parseCORSOrigin("https://cad.test-cad.example.com/")).toStrictEqual([
"https://cad.test-cad.example.com",
);
expect(parseCORSOrigin("https://cad.test-cad.example.com:3000/")).toBe(
]);
expect(parseCORSOrigin("https://cad.test-cad.example.com:3000/")).toStrictEqual([
"https://cad.test-cad.example.com:3000",
);
expect(parseCORSOrigin("https://cad.test-cad.example.com:3000")).toBe(
]);
expect(parseCORSOrigin("https://cad.test-cad.example.com:3000")).toStrictEqual([
"https://cad.test-cad.example.com:3000",
);
]);

expect(parseCORSOrigin("*")).toBe("*");
expect(parseCORSOrigin("invalid url")).toBe("invalid url");
expect(parseCORSOrigin("*")).toStrictEqual(["*"]);
expect(parseCORSOrigin("invalid url")).toStrictEqual([]);
});
});

0 comments on commit 5813aa2

Please sign in to comment.