Refactor plugin architecture, isolate Windows-spefic code

This commit is contained in:
Mateusz Tymek
2026-02-14 13:37:03 +01:00
parent 3d7c16fb2a
commit 9683eb0d05
17 changed files with 810 additions and 513 deletions

View File

@@ -0,0 +1,26 @@
import { describe, test, expect } from "bun:test";
import { WindowsProcess } from "../../src/server/process/WindowsProcess";
describe.skipIf(process.platform !== "win32")("WindowsProcess", () => {
const processImpl = new WindowsProcess();
describe("verifyCommand", () => {
test("returns null for existing executable in PATH", async () => {
// 'cmd' should exist on all Windows systems
const result = await processImpl.verifyCommand("cmd");
expect(result).toBeNull();
});
test("returns error message for non-existent executable", async () => {
const nonExistentPath = "C:\\nonexistent\\path\\to\\executable.exe";
const result = await processImpl.verifyCommand(nonExistentPath);
expect(result).toContain("Executable not found");
expect(result).toContain(nonExistentPath);
});
test("returns error for non-existent command in PATH", async () => {
const result = await processImpl.verifyCommand("definitely-not-a-real-command-12345");
expect(result).toContain("Executable not found");
});
});
});