From 625ffbd77f138080d79cc9382092f840d407ea3b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 30 Jan 2022 17:31:30 -0800 Subject: [PATCH] test: check for existence of binDir in the tests --- src/utils/tests/test-helpers.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/tests/test-helpers.ts b/src/utils/tests/test-helpers.ts index eef4da04..d1b6cfba 100644 --- a/src/utils/tests/test-helpers.ts +++ b/src/utils/tests/test-helpers.ts @@ -4,6 +4,7 @@ import * as path from "path" import { addBinExtension } from "../extension/extension" import { join } from "path" import spawn from "cross-spawn" +import { existsSync } from "fs" export async function setupTmpDir(testName: string) { const tempDirectory = path.join(tmpdir(), "setup-cpp", testName) @@ -38,10 +39,12 @@ export async function testBin( if (typeof binDir === "string") { expect(binDir).toBeDefined() expect(binDir).not.toHaveLength(0) + expect(existsSync(binDir)).toBeTruthy() bin = join(binDir, addBinExtension(name)) } if (args !== null) { + console.log(`Running ${bin} ${args.join(" ")}`) const { status } = spawn.sync(bin, args, { stdio: "inherit" }) expect(status).toBe(0) }