Skip to content

Commit

Permalink
Add tests for isGhes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Hadka committed Sep 29, 2020
1 parent 2850cd8 commit 0f71d4a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions __tests__/actionUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ afterEach(() => {
delete process.env[RefKey];
});

test("isGhes returns true if server url is not github.com", () => {
try {
process.env["GITHUB_SERVER_URL"] = "http://example.com";
expect(actionUtils.isGhes()).toBe(true);
} finally {
process.env["GITHUB_SERVER_URL"] = undefined;
}
});

test("isGhes returns true when server url is github.com", () => {
try {
process.env["GITHUB_SERVER_URL"] = "http://github.com";
expect(actionUtils.isGhes()).toBe(false);
} finally {
process.env["GITHUB_SERVER_URL"] = undefined;
}
});

test("isExactKeyMatch with undefined cache key returns false", () => {
const key = "linux-rust";
const cacheKey = undefined;
Expand Down

0 comments on commit 0f71d4a

Please sign in to comment.