Skip to content

Commit

Permalink
better assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymeng committed Dec 30, 2024
1 parent 0d1a041 commit b9f9a65
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sdk/tables/data-tables/test/internal/isCosmosEndpoint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ import { isCosmosEndpoint } from "../../src/utils/isCosmosEndpoint.js";
describe("isCosmosEndpoint", () => {
it("returns true for cosmosdb.* host", () => {
const result = isCosmosEndpoint("https://abc.table.cosmosdb.azure.com");
assert.equal(result, true);
assert.isTrue(result);
});

it("returns true for cosmos.* host", () => {
const result = isCosmosEndpoint("https://abc.table.cosmos.azure.com");
assert.equal(result, true);
assert.isTrue(result);
});

it("returns true for localhost", () => {
const result = isCosmosEndpoint("https://localhost:8092");
assert.equal(result, true);
assert.isTrue(result);
});

it("returns false for azurite default endpoint", () => {
const result = isCosmosEndpoint("https://127.0.0.1:10002/devstoreaccount1");
assert.equal(result, false);
assert.isFalse(result);
});

it("returns false for azurite default endpoint with non-default port", () => {
const result = isCosmosEndpoint("https://127.0.0.1:20002/devstoreaccount1");
assert.equal(result, false);
assert.isFalse(result);
});

it("returns false for azurite default localhost endpoint", () => {
const result = isCosmosEndpoint("https://localhost:10002/devstoreaccount1");
assert.equal(result, false);
assert.isFalse(result);
});

it("returns false for azurite default localhost endpoint with non-default port", () => {
const result = isCosmosEndpoint("https://localhost:20002/devstoreaccount1");
assert.equal(result, false);
assert.isFalse(result);
});
});

0 comments on commit b9f9a65

Please sign in to comment.