Skip to content

Commit

Permalink
refactor: set default base url to arkvault (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
dated authored Aug 3, 2022
1 parent 3c20fb4 commit 934d16f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/url-builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@ import { Networks } from "./enums";
import { URLBuilder } from "./url-builder";

describe("URLBuilder", () => {
it("should use default base url", () => {
const builder = new URLBuilder();

builder.setCoin("coin");
builder.setNethash("nethash");

expect(builder.generateTransfer("recipient")).toMatch(new RegExp("^https://app.arkvault.io/#/"));
});

it("should use given base url", () => {
const builder = new URLBuilder("baseUrl");

builder.setCoin("coin");
builder.setNethash("nethash");

expect(builder.generateTransfer("recipient")).toMatch(new RegExp("^baseUrl"));
});

it("should set coin", () => {
const builder = new URLBuilder("baseUrl");

Expand Down
2 changes: 1 addition & 1 deletion src/url-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class URLBuilder {
#coin: string | undefined;
#nethash: string | undefined;

public constructor(baseUrl: string) {
public constructor(baseUrl = "https://app.arkvault.io/#/") {
this.#baseUrl = baseUrl;
}

Expand Down

0 comments on commit 934d16f

Please sign in to comment.