fix(cli): remove unused createServer import and fix flaky port test
- Remove unused `createServer` import from web-dir.ts (only `Socket` is used) — fixes the lint error in CI - Mock `isPortAvailable` in the "uses port 3000" test so it doesn't depend on port 3000 actually being free on the host machine Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
06ba99eeb4
commit
dfcc0841ec
|
|
@ -42,6 +42,10 @@ describe("init command", () => {
|
|||
tmpDir = mkdtempSync(join(tmpdir(), "ao-init-test-"));
|
||||
const outputPath = join(tmpDir, "agent-orchestrator.yaml");
|
||||
|
||||
// Mock isPortAvailable so test doesn't depend on actual port 3000 being free
|
||||
const webDirModule = await import("../../src/lib/web-dir.js");
|
||||
vi.spyOn(webDirModule, "isPortAvailable").mockResolvedValue(true);
|
||||
|
||||
const program = new Command();
|
||||
program.exitOverride();
|
||||
registerInit(program);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Shared utility to avoid duplication between dashboard.ts and start.ts.
|
||||
*/
|
||||
|
||||
import { createServer, Socket } from "node:net";
|
||||
import { Socket } from "node:net";
|
||||
import { createRequire } from "node:module";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { resolve, dirname } from "node:path";
|
||||
|
|
|
|||
Loading…
Reference in New Issue