Skip to content

Commit 3fd1b0b

Browse files
committed
test: do not print version of apt-fast
1 parent 988b5fd commit 3fd1b0b

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

packages/setup-apt/__tests__/apt-fast.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ describe("setup-apt-fast", () => {
99
}
1010
it("should setup apt-fast", async () => {
1111
const installInfo = await setupAptFast()
12-
await testBin("apt-fast", ["--version"], installInfo?.binDir)
12+
await testBin("apt-fast", null, installInfo?.binDir)
1313
})
1414
})
Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
import spawn from "cross-spawn"
22
import { pathExists } from "path-exists"
3-
import { join } from "path/posix"
4-
import { addExeExt } from "patha"
3+
import { addExeExt, join } from "patha"
54
import which from "which"
65

76
export async function testBin(
87
name: string,
98
args: string[] | null = ["--version"],
109
binDir: string | undefined = undefined,
1110
) {
12-
try {
13-
let bin = name
14-
if (typeof binDir === "string") {
15-
console.log(`Testing the existence of ${binDir}`)
16-
expect(binDir).toBeDefined()
17-
expect(binDir).not.toHaveLength(0)
18-
expect(await pathExists(binDir)).toBeTruthy()
19-
bin = join(binDir, addExeExt(name))
20-
}
21-
22-
if (args !== null) {
23-
console.log(`Running ${bin} ${args.join(" ")}`)
24-
const { status } = spawn.sync(bin, args, { stdio: "inherit" })
25-
expect(status).toBe(0)
26-
}
11+
let bin = name
12+
if (typeof binDir === "string") {
13+
console.log(`Testing the existence of ${binDir}`)
14+
expect(binDir).toBeDefined()
15+
expect(binDir).not.toHaveLength(0)
16+
expect(await pathExists(binDir)).toBeTruthy()
17+
bin = join(binDir, addExeExt(name))
18+
}
2719

28-
expect((await which(name, { nothrow: true }))?.includes(bin))
29-
} catch (err) {
30-
throw new Error(`Failed to test bin ${name}: ${err}`)
20+
if (args !== null) {
21+
console.log(`Running ${bin} ${args.join(" ")}`)
22+
const { status } = spawn.sync(bin, args, { stdio: "inherit" })
23+
expect(status).toBe(0)
3124
}
25+
26+
expect((await which(name, { nothrow: true }))?.includes(bin))
3227
}

0 commit comments

Comments
 (0)