mirror of
https://github.com/nexu-io/open-design.git
synced 2026-05-31 19:04:39 +07:00
After tools-dev starts the daemon on an ephemeral port, print how to run `pnpm exec od` and export OD_DAEMON_URL so source installs do not hit the system BSD `od` binary or the packaged Docker default port. Related to #2801
27 lines
870 B
TypeScript
27 lines
870 B
TypeScript
import assert from "node:assert/strict";
|
|
import { describe, it } from "node:test";
|
|
|
|
import { formatSourceInstallCliHints } from "../src/cli-hints.js";
|
|
|
|
describe("formatSourceInstallCliHints", () => {
|
|
it("returns empty output when the daemon URL is unavailable", () => {
|
|
assert.deepEqual(
|
|
formatSourceInstallCliHints({
|
|
daemonUrl: null,
|
|
odBinPath: "/repo/node_modules/.bin/od",
|
|
}),
|
|
[],
|
|
);
|
|
});
|
|
|
|
it("prints pnpm exec od guidance and OD_DAEMON_URL export (#2801)", () => {
|
|
const text = formatSourceInstallCliHints({
|
|
daemonUrl: "http://127.0.0.1:49980",
|
|
odBinPath: "/repo/node_modules/.bin/od",
|
|
}).join("\n");
|
|
|
|
assert.match(text, /pnpm exec od skills list/);
|
|
assert.match(text, /export OD_DAEMON_URL=http:\/\/127\.0\.0\.1:49980/);
|
|
assert.match(text, /\/repo\/node_modules\/\.bin\/od/);
|
|
});
|
|
});
|