Skip to content

Commit ba77dcb

Browse files
Massimiliano Pippimasci
Massimiliano Pippi
authored andcommitted
fix token type
1 parent 91459e2 commit ba77dcb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

__tests__/main.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const toolDir = path.join(__dirname, "runner", "tools");
88
const tempDir = path.join(__dirname, "runner", "temp");
99
const dataDir = path.join(__dirname, "testdata");
1010
const IS_WINDOWS = process.platform === "win32";
11+
const GITHUB_TOKEN = process.env.GITHUB_TOKEN || "";
1112

1213
process.env["RUNNER_TEMP"] = tempDir;
1314
process.env["RUNNER_TOOL_CACHE"] = toolDir;
@@ -31,7 +32,7 @@ describe("installer tests", () => {
3132
});
3233

3334
it("Downloads version of protoc if no matching version is installed", async () => {
34-
await installer.getProtoc("3.9.0", true, process.env["GITHUB_TOKEN"]);
35+
await installer.getProtoc("3.9.0", true, GITHUB_TOKEN);
3536
const protocDir = path.join(toolDir, "protoc", "3.9.0", os.arch());
3637

3738
expect(fs.existsSync(`${protocDir}.complete`)).toBe(true);
@@ -58,7 +59,7 @@ describe("installer tests", () => {
5859
});
5960

6061
it("Gets the latest 3.7.x version of protoc using 3.7 and no matching version is installed", async () => {
61-
await installer.getProtoc("3.7", true, process.env["GITHUB_TOKEN"]);
62+
await installer.getProtoc("3.7", true, GITHUB_TOKEN);
6263
const protocDir = path.join(toolDir, "protoc", "3.7.1", os.arch());
6364

6465
expect(fs.existsSync(`${protocDir}.complete`)).toBe(true);
@@ -72,7 +73,7 @@ describe("installer tests", () => {
7273
}, 100000);
7374

7475
it("Gets latest version of protoc using 3.x and no matching version is installed", async () => {
75-
await installer.getProtoc("3.x", true, process.env["GITHUB_TOKEN"]);
76+
await installer.getProtoc("3.x", true, GITHUB_TOKEN);
7677
const protocDir = path.join(toolDir, "protoc", "3.9.1", os.arch());
7778

7879
expect(fs.existsSync(`${protocDir}.complete`)).toBe(true);

0 commit comments

Comments
 (0)