Skip to content

Commit 9a4cc34

Browse files
Massimiliano Pippimasci
Massimiliano Pippi
authored andcommitted
use github token during tests
1 parent c07b745 commit 9a4cc34

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ jobs:
3232
run: npm run format-check
3333

3434
- name: npm test
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3537
run: npm test

__tests__/main.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ process.env["RUNNER_TOOL_CACHE"] = toolDir;
1414
import * as installer from "../src/installer";
1515

1616
describe("installer tests", () => {
17-
beforeEach(async function() {
17+
beforeEach(async function () {
1818
await io.rmRF(toolDir);
1919
await io.rmRF(tempDir);
2020
await io.mkdirP(toolDir);
@@ -31,7 +31,7 @@ describe("installer tests", () => {
3131
});
3232

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

3737
expect(fs.existsSync(`${protocDir}.complete`)).toBe(true);
@@ -58,7 +58,7 @@ describe("installer tests", () => {
5858
});
5959

6060
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, "");
61+
await installer.getProtoc("3.7", true, process.env["GITHUB_TOKEN"]);
6262
const protocDir = path.join(toolDir, "protoc", "3.7.1", os.arch());
6363

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

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

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

0 commit comments

Comments
 (0)