Skip to content

Commit

Permalink
test: use which.sync in the msvc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Feb 2, 2022
1 parent 79da94e commit bb2e50e
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions src/msvc/__tests__/msvc.test.ts
Original file line number Diff line number Diff line change
@@ -1,73 +1,67 @@
import which from "which"
import { testBin } from "../../utils/tests/test-helpers"
import { setupMSVC } from "../msvc"

jest.setTimeout(300000)
describe("setup-msvc", () => {
it("should setup the pre-installed msvc", async () => {
it("should setup the pre-installed msvc", () => {
try {
if (process.platform !== "win32") {
return
}
await setupMSVC("", "", process.arch)
await testBin("cl", [])
console.log(which("cl"))
setupMSVC("", "", process.arch)
console.log(which.sync("cl"))
} catch (e) {
// TODO
console.error(e)
}
})

it("should setup msvc 2022", async () => {
it("should setup msvc 2022", () => {
try {
if (process.platform !== "win32") {
return
}
await setupMSVC("2022", "", process.arch)
await testBin("cl", [])
console.log(which("cl"))
setupMSVC("2022", "", process.arch)
console.log(which.sync("cl"))
} catch (e) {
// TODO
console.error(e)
}
})

it("should setup msvc 2019", async () => {
it("should setup msvc 2019", () => {
try {
if (process.platform !== "win32") {
return
}
await setupMSVC("2019", "", process.arch)
await testBin("cl", [])
console.log(which("cl"))
setupMSVC("2019", "", process.arch)
console.log(which.sync("cl"))
} catch (e) {
// TODO
console.error(e)
}
})

it("should setup msvc 2017", async () => {
it("should setup msvc 2017", () => {
try {
if (process.platform !== "win32") {
return
}
await setupMSVC("2017", "", process.arch)
await testBin("cl", [])
console.log(which("cl"))
setupMSVC("2017", "", process.arch)
console.log(which.sync("cl"))
} catch (e) {
// TODO
console.error(e)
}
})

it("should setup msvc 2015", async () => {
it("should setup msvc 2015", () => {
try {
if (process.platform !== "win32") {
return
}
await setupMSVC("2015", "", process.arch)
await testBin("cl", [])
console.log(which("cl"))
setupMSVC("2015", "", process.arch)
console.log(which.sync("cl"))
} catch (e) {
// TODO
console.error(e)
Expand Down

0 comments on commit bb2e50e

Please sign in to comment.