Skip to content

Commit

Permalink
test: add external URL test for hyphenated urls
Browse files Browse the repository at this point in the history
  • Loading branch information
andruwm committed Dec 23, 2024
1 parent 390343a commit 3c7c960
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions __tests__/discovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const pairs = {
SERVICE_MISSING_PROTO_AND_HOST_FOOBAR_PORT: "8000",
EXTERNAL_URL_CLEVER_COM: "https://clever.com:443",
EXTERNAL_URL_API_CLEVER_COM: "https://api.clever.com:443",
EXTERNAL_URL_DIAGNOSTICS_APP_CLEVER_COM: "https://diagnostics-app.clever.com:443",
};

describe("discovery", () => {
Expand Down Expand Up @@ -110,6 +111,13 @@ describe("discovery", () => {
assert.equal(ex_disc.host(), "api.clever.com");
assert.equal(ex_disc.host_port(), "api.clever.com:443");
});
it("test external url with hyphens", () => {
const ex_disc = external("diagnostics-app.clever.com");
assert.equal(ex_disc.url(), "https://diagnostics-app.clever.com:443");
assert.equal(ex_disc.proto_host(), "https://diagnostics-app.clever.com");
assert.equal(ex_disc.host(), "diagnostics-app.clever.com");
assert.equal(ex_disc.host_port(), "diagnostics-app.clever.com:443");
});
return it("test expect error on missing two vars", () => {
const disc = discovery("missing-proto-and-host", "foobar");
assert.equal(disc.port(), "8000");
Expand Down

0 comments on commit 3c7c960

Please sign in to comment.