refactor(ito): share invocation command detection

This commit is contained in:
Affaan Mustafa
2026-07-24 00:48:13 -04:00
parent 2e3696ae50
commit 4bd94695b1
3 changed files with 14 additions and 2 deletions
+6
View File
@@ -20,6 +20,7 @@ const {
} = require("../../scripts/ito");
const {
createSafeItoInvocationEnvironment,
getInvocationCommand,
} = require("../../scripts/lib/ito-environment");
function runCli(args, environment = {}) {
@@ -323,6 +324,11 @@ function main() {
assert.strictEqual(safe.ITO_API_KEY, undefined);
assert.strictEqual(safe.SIXTYTWO_TOKEN, undefined);
}],
["detects the Itō command consistently with or without the global JSON flag", () => {
assert.strictEqual(getInvocationCommand(["auth"]), "auth");
assert.strictEqual(getInvocationCommand(["--json", "evals"]), "evals");
assert.strictEqual(getInvocationCommand([]), undefined);
}],
["bounds the outer node-qualification process beyond the canonical timeout", () => {
assert.strictEqual(NODE_QUALIFICATION_TIMEOUT_MS, 31 * 60 * 1000);
const source = fs.readFileSync(ITO_SCRIPT, "utf8");