Skip to content

Commit aa96482

Browse files
committed
test: mark the skipped tests in jest
1 parent b105596 commit aa96482

File tree

7 files changed

+33
-26
lines changed

7 files changed

+33
-26
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"ignorePatterns": ["dist/", "node_modules/", "dev/cpp_vcpkg_project"],
44
"rules": {
55
"no-unused-vars": "off",
6+
"no-empty-function": "off",
67
"@typescript-eslint/no-unused-vars": [
78
"warn",
89
{

src/brew/__tests__/brew.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers"
33

44
jest.setTimeout(300000)
55
describe("setup-brew", () => {
6+
if (process.platform === "win32") {
7+
it.skip("should setup brew", () => {})
8+
return
9+
}
610
it("should setup brew", async () => {
7-
if (process.platform !== "darwin") {
8-
return
9-
}
1011
const installInfo = await setupBrew("", "", process.arch)
1112
await testBin("brew", ["--version"], installInfo?.binDir)
1213
})

src/chocolatey/__tests__/chocolatey.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { setupChocolatey } from "../chocolatey"
44

55
jest.setTimeout(300000)
66
describe("setup-chocolatey", () => {
7+
if (process.platform !== "win32") {
8+
it.skip("should setup chocolatey", () => {})
9+
return
10+
}
711
it("should setup chocolatey", async () => {
8-
if (process.platform !== "win32") {
9-
return
10-
}
1112
const { binDir } = (await setupChocolatey("", "", process.arch)) as InstallationInfo
1213
await testBin("choco", ["--version"], binDir)
1314
})

src/macos-sdk/__tests__/macos-sdk.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { setupMacOSSDK } from "../macos-sdk"
22

33
jest.setTimeout(300000)
44
describe("setup-macos-sdk", () => {
5+
if (process.platform !== "darwin") {
6+
it.skip("should setup macos-sdk", () => {})
7+
return
8+
}
59
it("should setup macos-sdk", async () => {
6-
if (process.platform === "darwin") {
7-
process.env.SDKROOT = undefined
8-
await setupMacOSSDK()
9-
expect(process.env.SDKROOT).toBeTruthy()
10-
expect(typeof process.env.SDKROOT).toBe("string")
11-
}
10+
process.env.SDKROOT = undefined
11+
await setupMacOSSDK()
12+
expect(process.env.SDKROOT).toBeTruthy()
13+
expect(typeof process.env.SDKROOT).toBe("string")
1214
})
1315
})

src/msvc/__tests__/msvc.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import { warning } from "ci-log"
55

66
jest.setTimeout(300000)
77
describe("setup-msvc", () => {
8-
const isWindows = process.platform === "win32"
9-
8+
if (process.platform !== "win32") {
9+
it.skip("should setup msvc", () => {})
10+
return
11+
}
1012
it("should setup the pre-installed msvc", async () => {
1113
try {
12-
if (!isWindows) {
13-
return
14-
}
1514
await setupMSVC("", "", process.arch)
1615
console.log(which.sync("cl"))
1716
} catch (err) {
@@ -22,10 +21,11 @@ describe("setup-msvc", () => {
2221
})
2322

2423
for (const version of [2022, 2019, 2017, 2015]) {
24+
if (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version) {
25+
it.skip(`should setup msvc ${version}`, () => {})
26+
return
27+
}
2528
it(`should setup msvc ${version}`, async () => {
26-
if (!isWindows || (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version)) {
27-
return
28-
}
2929
try {
3030
await setupMSVC(`${version}`, "", process.arch)
3131
console.log(which.sync("cl"))

src/nala/__tests__/nala.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { isUbuntu } from "../../utils/env/isUbuntu"
44

55
jest.setTimeout(300000)
66
describe("setup-nala", () => {
7+
if (!isUbuntu()) {
8+
test.skip("should setup nala", () => {})
9+
return
10+
}
711
it("should setup nala", async () => {
8-
if (!isUbuntu()) {
9-
return
10-
}
1112
const installInfo = await setupNala("", "", process.arch)
1213
await testBin("nala", ["--version"], installInfo?.binDir)
1314
})

src/opencppcoverage/__tests__/opencppcoverage.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers"
33

44
jest.setTimeout(300000)
55
describe("setup-OpenCppCoverage", () => {
6+
if (process.platform !== "win32") {
7+
it.skip("should setup OpenCppCoverage", () => {})
8+
return
9+
}
610
it("should setup OpenCppCoverage", async () => {
7-
if (process.platform !== "win32") {
8-
return
9-
}
1011
const installationInfo = await setupOpencppcoverage("", "", process.arch)
1112

1213
await testBin("OpenCppCoverage", null, installationInfo?.binDir) // OpenCppCoverage exits with non-zero even with --help

0 commit comments

Comments
 (0)