Skip to content

Commit 3e37b46

Browse files
committed
Test for presence of shadowenv binary before running Shadowenv suite
Not all non-Shopify developer environments have a version of shadowenv installed. In those circumstances, skip the suite with a console warning. Part of Shopify#2877
1 parent 3b5a9ff commit 3e37b46

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

vscode/src/test/suite/ruby/shadowenv.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ import { LOG_CHANNEL, asyncExec } from "../../../common";
1414
import { RUBY_VERSION } from "../../rubyVersion";
1515
import * as common from "../../../common";
1616

17-
suite("Shadowenv", () => {
17+
suite("Shadowenv", async () => {
1818
if (os.platform() === "win32") {
1919
// eslint-disable-next-line no-console
2020
console.log("Skipping Shadowenv tests on Windows");
2121
return;
2222
}
2323

24+
try {
25+
await asyncExec("shadowenv --version");
26+
} catch {
27+
console.log("Skipping Shadowenv tests because no `shadowenv` found");
28+
return;
29+
}
30+
2431
let rootPath: string;
2532
let workspacePath: string;
2633
let workspaceFolder: vscode.WorkspaceFolder;

0 commit comments

Comments
 (0)