test: use which.sync in the msvc tests

This commit is contained in:
Amin Yahyaabadi 2022-02-01 20:54:32 -08:00
parent 79da94e09e
commit bb2e50ea8f
1 changed files with 15 additions and 21 deletions

View File

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