Skip to content

Commit 0f71d4a

Browse files
committed
Add tests for isGhes
1 parent 2850cd8 commit 0f71d4a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

__tests__/actionUtils.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ afterEach(() => {
1717
delete process.env[RefKey];
1818
});
1919

20+
test("isGhes returns true if server url is not github.com", () => {
21+
try {
22+
process.env["GITHUB_SERVER_URL"] = "http://example.com";
23+
expect(actionUtils.isGhes()).toBe(true);
24+
} finally {
25+
process.env["GITHUB_SERVER_URL"] = undefined;
26+
}
27+
});
28+
29+
test("isGhes returns true when server url is github.com", () => {
30+
try {
31+
process.env["GITHUB_SERVER_URL"] = "http://github.com";
32+
expect(actionUtils.isGhes()).toBe(false);
33+
} finally {
34+
process.env["GITHUB_SERVER_URL"] = undefined;
35+
}
36+
});
37+
2038
test("isExactKeyMatch with undefined cache key returns false", () => {
2139
const key = "linux-rust";
2240
const cacheKey = undefined;

0 commit comments

Comments
 (0)