test: report Windows locator failures

This commit is contained in:
Kashyab Ambarani
2026-09-25 03:45:42 -07:00
parent bbefd49833
commit ce6ba534f7
+4 -1
View File
@@ -3,6 +3,7 @@ import test from "node:test";
import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs"; import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs";
import { tmpdir } from "node:os"; import { tmpdir } from "node:os";
import { dirname, join } from "node:path"; import { dirname, join } from "node:path";
import { spawnSync } from "node:child_process";
import { clearDevinBinCache, findDevinBin, whichDevin, runDevin } from "../src/cli.ts"; import { clearDevinBinCache, findDevinBin, whichDevin, runDevin } from "../src/cli.ts";
function fixture(t) { function fixture(t) {
@@ -47,7 +48,9 @@ test("Windows PATH lookup uses where.exe and reads multiple results", { skip: pr
const bin = join(directory, "path bin"); mkdirSync(bin); const bin = join(directory, "path bin"); mkdirSync(bin);
const binary = join(bin, "devin.exe"); writeFileSync(binary, ""); const binary = join(bin, "devin.exe"); writeFileSync(binary, "");
process.env.PATH = `${bin};${process.env.PATH}`; process.env.PATH = `${bin};${process.env.PATH}`;
assert.equal(await whichDevin(), binary); const located = await whichDevin();
const probe = spawnSync("where.exe", ["devin.exe"], { encoding: "utf8" });
assert.equal(located, binary, JSON.stringify({ status: probe.status, stdout: probe.stdout, stderr: probe.stderr, error: probe.error?.message }));
}); });
test("Windows batch wrappers work in paths with spaces, including inherited stdio", { skip: process.platform !== "win32" }, async (t) => { test("Windows batch wrappers work in paths with spaces, including inherited stdio", { skip: process.platform !== "win32" }, async (t) => {