Skip to content

Commit

Permalink
removes unused funciton
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabib committed Nov 22, 2024
1 parent 9979071 commit 20cad32
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
3 changes: 0 additions & 3 deletions frontend/src/lib/utils/env.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ export const isNnsAlternativeOrigin = (): boolean => {
return NNS_IC_ORG_ALTERNATIVE_ORIGINS.includes(origin);
};

export const isLocalhost = (hostname: string) =>
hostname.includes("localhost") || hostname.includes("127.0.0.1");

// Given the used strategy and whether the current call is certified, returns
// whether this is the last call.
//
Expand Down
24 changes: 1 addition & 23 deletions frontend/src/tests/lib/utils/env.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
isLastCall,
isLocalhost,
isNnsAlternativeOrigin,
} from "$lib/utils/env.utils";
import { isLastCall, isNnsAlternativeOrigin } from "$lib/utils/env.utils";

describe("env-utils", () => {
describe("isNnsAlternativeOrigin", () => {
Expand Down Expand Up @@ -63,24 +59,6 @@ describe("env-utils", () => {
});
});

describe("isLocalhost", () => {
it("return false when hostname is not localhost", () => {
expect(
isLocalhost(
"53zcu-tiaaa-aaaaa-qaaba-cai.medium09.testnet.dfinity.network"
)
).toBe(false);
expect(isLocalhost("internetcomputer.org")).toBe(false);
expect(isLocalhost("nns.ic0.app")).toBe(false);
});

it("return true when hostname is localhost", () => {
expect(isLocalhost("localhost:3000")).toBe(true);
expect(isLocalhost("127.0.0.1:3000")).toBe(true);
expect(isLocalhost("xxxx.localhost")).toBe(true);
});
});

describe("isLastCall", () => {
it("should return true when certified", () => {
expect(
Expand Down

0 comments on commit 20cad32

Please sign in to comment.