-
-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathinstaller.test.ts
More file actions
63 lines (54 loc) · 1.72 KB
/
installer.test.ts
File metadata and controls
63 lines (54 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { promises as fs } from "fs";
import * as path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const tempDir = path.join(__dirname, "_temp");
process.env["RUNNER_TEMP"] = tempDir;
import * as io from "@actions/io";
import * as exec from "@actions/exec";
import * as installer from "../src/installer.js";
describe("installer", () => {
beforeAll(async () => {
await io.mkdirP(tempDir);
});
afterAll(async () => {
await io.rmRF(tempDir);
});
it(
"installs specific version of reviewdog",
async () => {
const dir = await fs.mkdtemp(path.join(tempDir, "reviewdog-"));
const reviewdog = await installer.installReviewdog("v0.12.0", dir);
await exec.exec(reviewdog, ["--version"]);
},
5 * 60 * 1000,
);
it(
"installs the latest version of reviewdog",
async () => {
const dir = await fs.mkdtemp(path.join(tempDir, "reviewdog-"));
const reviewdog = await installer.installReviewdog("latest", dir);
await exec.exec(reviewdog, ["--version"]);
},
5 * 60 * 1000,
);
it(
"installs specific version of golangci-lint",
async () => {
const dir = await fs.mkdtemp(path.join(tempDir, "golangci-"));
const golangci = await installer.installGolangciLint("v1.41.1", dir);
await exec.exec(golangci, ["--version"]);
},
5 * 60 * 1000,
);
it(
"installs the latest version of golangci-lint",
async () => {
const dir = await fs.mkdtemp(path.join(tempDir, "golangci-"));
const golangci = await installer.installGolangciLint("latest", dir);
await exec.exec(golangci, ["--version"]);
},
5 * 60 * 1000,
);
});