Skip to content

Commit 3f44a13

Browse files
committed
auto use default jsc
1 parent 3a351c4 commit 3f44a13

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/run-shell.mjs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ function sh(binary, args) {
122122
}
123123
}
124124

125-
DEFAULT_JSC_LOCATION = "/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Helpers/jsc"
126-
127125
async function runTests() {
128126
const shellBinary = logGroup(`Installing JavaScript Shell: ${SHELL_NAME}`, testSetup);
129127
runTest("Run Complete Suite", () => sh(shellBinary, [CLI_PATH]));
@@ -153,10 +151,17 @@ function jsvuOSName() {
153151
return `${osName()}${osArch()}`
154152
}
155153

154+
DEFAULT_JSC_LOCATION = "/System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Helpers/jsc"
155+
156156
function testSetup() {
157-
const jsvuOS = "mac64arm";
158-
sh("jsvu", [`--engines=${SHELL_NAME}`, `--os=${jsvuOSName()}`]);
159-
const shellBinary = path.join(os.homedir(), ".jsvu/bin", SHELL_NAME);
157+
let shellBinary;
158+
try {
159+
sh("jsvu", [`--engines=${SHELL_NAME}`, `--os=${jsvuOSName()}`]);
160+
shellBinary = path.join(os.homedir(), ".jsvu/bin", SHELL_NAME);
161+
} catch {
162+
if (SHELL_NAME == "javascriptcore")
163+
shellBinary = DEFAULT_JSC_LOCATION
164+
}
160165
if (!fs.existsSync(shellBinary))
161166
throw new Error(`Could not find shell binary: ${shellBinary}`);
162167
log(`Installed JavaScript Shell: ${shellBinary}`);

0 commit comments

Comments
 (0)