mirror of
https://github.com/getpaseo/paseo.git
synced 2026-08-14 12:23:16 +00:00
fix: format executable test
This commit is contained in:
@@ -149,19 +149,22 @@ describe("findExecutable", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.skipIf(process.platform === "win32")("warns and returns null when the final which line is not an absolute path", async () => {
|
test.skipIf(process.platform === "win32")(
|
||||||
const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => {});
|
"warns and returns null when the final which line is not an absolute path",
|
||||||
const { findExecutable } = await loadExecutableModule({
|
async () => {
|
||||||
execFileImpl: (_command, _args, _options, callback) => {
|
const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => {});
|
||||||
callback(null, "codex\n", "");
|
const { findExecutable } = await loadExecutableModule({
|
||||||
},
|
execFileImpl: (_command, _args, _options, callback) => {
|
||||||
});
|
callback(null, "codex\n", "");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
await expect(findExecutable("codex")).resolves.toBeNull();
|
await expect(findExecutable("codex")).resolves.toBeNull();
|
||||||
expect(warnSpy).toHaveBeenCalledOnce();
|
expect(warnSpy).toHaveBeenCalledOnce();
|
||||||
|
|
||||||
warnSpy.mockRestore();
|
warnSpy.mockRestore();
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test("returns null when which lookup fails", async () => {
|
test("returns null when which lookup fails", async () => {
|
||||||
const { findExecutable } = await loadExecutableModule({
|
const { findExecutable } = await loadExecutableModule({
|
||||||
|
|||||||
Reference in New Issue
Block a user