Template
1
0
mirror of https://github.com/aminya/setup-cpp synced 2024-11-30 21:22:30 +08:00

test: mark the skipped tests in jest

This commit is contained in:
Amin Yahyaabadi 2023-09-04 19:27:23 -07:00
parent b10559687a
commit aa96482204
7 changed files with 33 additions and 26 deletions

View File

@ -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",
{

View File

@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers"
jest.setTimeout(300000)
describe("setup-brew", () => {
it("should setup brew", async () => {
if (process.platform !== "darwin") {
if (process.platform === "win32") {
it.skip("should setup brew", () => {})
return
}
it("should setup brew", async () => {
const installInfo = await setupBrew("", "", process.arch)
await testBin("brew", ["--version"], installInfo?.binDir)
})

View File

@ -4,10 +4,11 @@ import { setupChocolatey } from "../chocolatey"
jest.setTimeout(300000)
describe("setup-chocolatey", () => {
it("should setup chocolatey", async () => {
if (process.platform !== "win32") {
it.skip("should setup chocolatey", () => {})
return
}
it("should setup chocolatey", async () => {
const { binDir } = (await setupChocolatey("", "", process.arch)) as InstallationInfo
await testBin("choco", ["--version"], binDir)
})

View File

@ -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")
}
})
})

View File

@ -5,13 +5,12 @@ import { warning } from "ci-log"
jest.setTimeout(300000)
describe("setup-msvc", () => {
const isWindows = process.platform === "win32"
it("should setup the pre-installed msvc", async () => {
try {
if (!isWindows) {
if (process.platform !== "win32") {
it.skip("should setup msvc", () => {})
return
}
it("should setup the pre-installed msvc", async () => {
try {
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]) {
it(`should setup msvc ${version}`, async () => {
if (!isWindows || (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version)) {
if (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version) {
it.skip(`should setup msvc ${version}`, () => {})
return
}
it(`should setup msvc ${version}`, async () => {
try {
await setupMSVC(`${version}`, "", process.arch)
console.log(which.sync("cl"))

View File

@ -4,10 +4,11 @@ import { isUbuntu } from "../../utils/env/isUbuntu"
jest.setTimeout(300000)
describe("setup-nala", () => {
it("should setup nala", async () => {
if (!isUbuntu()) {
test.skip("should setup nala", () => {})
return
}
it("should setup nala", async () => {
const installInfo = await setupNala("", "", process.arch)
await testBin("nala", ["--version"], installInfo?.binDir)
})

View File

@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers"
jest.setTimeout(300000)
describe("setup-OpenCppCoverage", () => {
it("should setup OpenCppCoverage", async () => {
if (process.platform !== "win32") {
it.skip("should setup OpenCppCoverage", () => {})
return
}
it("should setup OpenCppCoverage", async () => {
const installationInfo = await setupOpencppcoverage("", "", process.arch)
await testBin("OpenCppCoverage", null, installationInfo?.binDir) // OpenCppCoverage exits with non-zero even with --help