diff --git a/.eslintrc.json b/.eslintrc.json index 2510b49e..c419bc57 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,6 +3,7 @@ "ignorePatterns": ["dist/", "node_modules/", "dev/cpp_vcpkg_project"], "rules": { "no-unused-vars": "off", + "no-empty-function": "off", "@typescript-eslint/no-unused-vars": [ "warn", { diff --git a/src/brew/__tests__/brew.test.ts b/src/brew/__tests__/brew.test.ts index a2fff969..8be0daed 100644 --- a/src/brew/__tests__/brew.test.ts +++ b/src/brew/__tests__/brew.test.ts @@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers" jest.setTimeout(300000) describe("setup-brew", () => { + if (process.platform === "win32") { + it.skip("should setup brew", () => {}) + return + } it("should setup brew", async () => { - if (process.platform !== "darwin") { - return - } const installInfo = await setupBrew("", "", process.arch) await testBin("brew", ["--version"], installInfo?.binDir) }) diff --git a/src/chocolatey/__tests__/chocolatey.test.ts b/src/chocolatey/__tests__/chocolatey.test.ts index ce62cb34..ce39d9f2 100644 --- a/src/chocolatey/__tests__/chocolatey.test.ts +++ b/src/chocolatey/__tests__/chocolatey.test.ts @@ -4,10 +4,11 @@ import { setupChocolatey } from "../chocolatey" jest.setTimeout(300000) describe("setup-chocolatey", () => { + if (process.platform !== "win32") { + it.skip("should setup chocolatey", () => {}) + return + } it("should setup chocolatey", async () => { - if (process.platform !== "win32") { - return - } const { binDir } = (await setupChocolatey("", "", process.arch)) as InstallationInfo await testBin("choco", ["--version"], binDir) }) diff --git a/src/macos-sdk/__tests__/macos-sdk.test.ts b/src/macos-sdk/__tests__/macos-sdk.test.ts index 4f096bcb..7f376efa 100644 --- a/src/macos-sdk/__tests__/macos-sdk.test.ts +++ b/src/macos-sdk/__tests__/macos-sdk.test.ts @@ -2,12 +2,14 @@ import { setupMacOSSDK } from "../macos-sdk" jest.setTimeout(300000) describe("setup-macos-sdk", () => { + if (process.platform !== "darwin") { + it.skip("should setup macos-sdk", () => {}) + return + } it("should setup macos-sdk", async () => { - if (process.platform === "darwin") { - process.env.SDKROOT = undefined - await setupMacOSSDK() - expect(process.env.SDKROOT).toBeTruthy() - expect(typeof process.env.SDKROOT).toBe("string") - } + process.env.SDKROOT = undefined + await setupMacOSSDK() + expect(process.env.SDKROOT).toBeTruthy() + expect(typeof process.env.SDKROOT).toBe("string") }) }) diff --git a/src/msvc/__tests__/msvc.test.ts b/src/msvc/__tests__/msvc.test.ts index c18f9783..bb1b8047 100644 --- a/src/msvc/__tests__/msvc.test.ts +++ b/src/msvc/__tests__/msvc.test.ts @@ -5,13 +5,12 @@ import { warning } from "ci-log" jest.setTimeout(300000) describe("setup-msvc", () => { - const isWindows = process.platform === "win32" - + if (process.platform !== "win32") { + it.skip("should setup msvc", () => {}) + return + } it("should setup the pre-installed msvc", async () => { try { - if (!isWindows) { - return - } await setupMSVC("", "", process.arch) console.log(which.sync("cl")) } catch (err) { @@ -22,10 +21,11 @@ describe("setup-msvc", () => { }) for (const version of [2022, 2019, 2017, 2015]) { + if (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version) { + it.skip(`should setup msvc ${version}`, () => {}) + return + } it(`should setup msvc ${version}`, async () => { - if (!isWindows || (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version)) { - return - } try { await setupMSVC(`${version}`, "", process.arch) console.log(which.sync("cl")) diff --git a/src/nala/__tests__/nala.test.ts b/src/nala/__tests__/nala.test.ts index 681064e7..7664b3b0 100644 --- a/src/nala/__tests__/nala.test.ts +++ b/src/nala/__tests__/nala.test.ts @@ -4,10 +4,11 @@ import { isUbuntu } from "../../utils/env/isUbuntu" jest.setTimeout(300000) describe("setup-nala", () => { + if (!isUbuntu()) { + test.skip("should setup nala", () => {}) + return + } it("should setup nala", async () => { - if (!isUbuntu()) { - return - } const installInfo = await setupNala("", "", process.arch) await testBin("nala", ["--version"], installInfo?.binDir) }) diff --git a/src/opencppcoverage/__tests__/opencppcoverage.test.ts b/src/opencppcoverage/__tests__/opencppcoverage.test.ts index 1e2fd554..7d530259 100644 --- a/src/opencppcoverage/__tests__/opencppcoverage.test.ts +++ b/src/opencppcoverage/__tests__/opencppcoverage.test.ts @@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers" jest.setTimeout(300000) describe("setup-OpenCppCoverage", () => { + if (process.platform !== "win32") { + it.skip("should setup OpenCppCoverage", () => {}) + return + } it("should setup OpenCppCoverage", async () => { - if (process.platform !== "win32") { - return - } const installationInfo = await setupOpencppcoverage("", "", process.arch) await testBin("OpenCppCoverage", null, installationInfo?.binDir) // OpenCppCoverage exits with non-zero even with --help