From e6a4d529fc87ce9d65efaf7e07c9857986428dab Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 11:54:36 -0500 Subject: [PATCH] fix: return the installInfo object from setupPipPack --- src/conan/__tests__/conan.test.ts | 3 +-- src/gcovr/__tests__/gcovr.test.ts | 3 +-- src/gcovr/gcovr.ts | 4 ++-- src/meson/__tests__/meson.test.ts | 3 +-- src/utils/setup/setupPipPack.ts | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/conan/__tests__/conan.test.ts b/src/conan/__tests__/conan.test.ts index ae190439..3823fee7 100644 --- a/src/conan/__tests__/conan.test.ts +++ b/src/conan/__tests__/conan.test.ts @@ -1,12 +1,11 @@ import { setupConan } from "../conan" import { testBin } from "../../utils/tests/test-helpers" -import { InstallationInfo } from "../../utils/setup/setupBin" jest.setTimeout(200000) describe("setup-conan", () => { it("should setup conan", async () => { const installInfo = await setupConan("", "", "") - await testBin("conan", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir) + await testBin("conan", ["--version"], installInfo.binDir) }) }) diff --git a/src/gcovr/__tests__/gcovr.test.ts b/src/gcovr/__tests__/gcovr.test.ts index d91bae44..3ef4b7a9 100644 --- a/src/gcovr/__tests__/gcovr.test.ts +++ b/src/gcovr/__tests__/gcovr.test.ts @@ -1,11 +1,10 @@ import { setupGcovr } from "../gcovr" import { testBin } from "../../utils/tests/test-helpers" -import { InstallationInfo } from "../../utils/setup/setupBin" jest.setTimeout(200000) describe("setup-gcovr", () => { it("should setup gcovr", async () => { const installInfo = await setupGcovr("", "", "") - await testBin("gcovr", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir) + await testBin("gcovr", ["--version"], installInfo.binDir) }) }) diff --git a/src/gcovr/gcovr.ts b/src/gcovr/gcovr.ts index dea71581..b3484090 100644 --- a/src/gcovr/gcovr.ts +++ b/src/gcovr/gcovr.ts @@ -1,6 +1,6 @@ import { setupPipPack } from "../utils/setup/setupPipPack" // eslint-disable-next-line @typescript-eslint/no-unused-vars -export async function setupGcovr(version: string | undefined, _setupCppDir: string, _arch: string) { - await setupPipPack("gcovr", version) +export function setupGcovr(version: string | undefined, _setupCppDir: string, _arch: string) { + return setupPipPack("gcovr", version) } diff --git a/src/meson/__tests__/meson.test.ts b/src/meson/__tests__/meson.test.ts index 6f43df50..6001f553 100644 --- a/src/meson/__tests__/meson.test.ts +++ b/src/meson/__tests__/meson.test.ts @@ -1,12 +1,11 @@ import { setupMeson } from "../meson" import { testBin } from "../../utils/tests/test-helpers" -import { InstallationInfo } from "../../utils/setup/setupBin" jest.setTimeout(200000) describe("setup-meson", () => { it("should setup meson", async () => { const installInfo = await setupMeson("", "", "") - await testBin("meson", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir) + await testBin("meson", ["--version"], installInfo.binDir) }) }) diff --git a/src/utils/setup/setupPipPack.ts b/src/utils/setup/setupPipPack.ts index c4500125..e175ef40 100644 --- a/src/utils/setup/setupPipPack.ts +++ b/src/utils/setup/setupPipPack.ts @@ -44,5 +44,5 @@ export async function setupPipPack(name: string, version?: string) { } } - return binDir + return { binDir } }