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 which from "which"
import { testBin } from "../../utils/tests/test-helpers"
import { setupMSVC } from "../msvc" import { setupMSVC } from "../msvc"
jest.setTimeout(300000) jest.setTimeout(300000)
describe("setup-msvc", () => { describe("setup-msvc", () => {
it("should setup the pre-installed msvc", async () => { it("should setup the pre-installed msvc", () => {
try { try {
if (process.platform !== "win32") { if (process.platform !== "win32") {
return return
} }
await setupMSVC("", "", process.arch) setupMSVC("", "", process.arch)
await testBin("cl", []) console.log(which.sync("cl"))
console.log(which("cl"))
} catch (e) { } catch (e) {
// TODO // TODO
console.error(e) console.error(e)
} }
}) })
it("should setup msvc 2022", async () => { it("should setup msvc 2022", () => {
try { try {
if (process.platform !== "win32") { if (process.platform !== "win32") {
return return
} }
await setupMSVC("2022", "", process.arch) setupMSVC("2022", "", process.arch)
await testBin("cl", []) console.log(which.sync("cl"))
console.log(which("cl"))
} catch (e) { } catch (e) {
// TODO // TODO
console.error(e) console.error(e)
} }
}) })
it("should setup msvc 2019", async () => { it("should setup msvc 2019", () => {
try { try {
if (process.platform !== "win32") { if (process.platform !== "win32") {
return return
} }
await setupMSVC("2019", "", process.arch) setupMSVC("2019", "", process.arch)
await testBin("cl", []) console.log(which.sync("cl"))
console.log(which("cl"))
} catch (e) { } catch (e) {
// TODO // TODO
console.error(e) console.error(e)
} }
}) })
it("should setup msvc 2017", async () => { it("should setup msvc 2017", () => {
try { try {
if (process.platform !== "win32") { if (process.platform !== "win32") {
return return
} }
await setupMSVC("2017", "", process.arch) setupMSVC("2017", "", process.arch)
await testBin("cl", []) console.log(which.sync("cl"))
console.log(which("cl"))
} catch (e) { } catch (e) {
// TODO // TODO
console.error(e) console.error(e)
} }
}) })
it("should setup msvc 2015", async () => { it("should setup msvc 2015", () => {
try { try {
if (process.platform !== "win32") { if (process.platform !== "win32") {
return return
} }
await setupMSVC("2015", "", process.arch) setupMSVC("2015", "", process.arch)
await testBin("cl", []) console.log(which.sync("cl"))
console.log(which("cl"))
} catch (e) { } catch (e) {
// TODO // TODO
console.error(e) console.error(e)