feat(FN-1831): merge fusion/fn-1831
This commit is contained in:
@@ -4,6 +4,7 @@ const runTaskCreate = vi.fn();
|
||||
const runTaskList = vi.fn();
|
||||
const runDesktop = vi.fn();
|
||||
const runServe = vi.fn();
|
||||
const runDaemon = vi.fn();
|
||||
const runTaskPlan = vi.fn();
|
||||
const runTaskImportFromGitHub = vi.fn();
|
||||
const runSettingsShow = vi.fn();
|
||||
@@ -50,6 +51,10 @@ vi.mock("../commands/serve.js", () => ({
|
||||
runServe,
|
||||
}));
|
||||
|
||||
vi.mock("../commands/daemon.js", () => ({
|
||||
runDaemon,
|
||||
}));
|
||||
|
||||
vi.mock("../commands/task.js", () => ({
|
||||
runTaskCreate,
|
||||
runTaskList,
|
||||
@@ -326,6 +331,32 @@ describe("bin", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("routes daemon command with port, host, token, paused, and token-only flags", async () => {
|
||||
await runBin(["daemon", "--port", "4040", "--host", "127.0.0.1", "--token", "fn_abc123", "--paused", "--token-only"]);
|
||||
|
||||
expect(runDaemon).toHaveBeenCalledWith({
|
||||
port: 4040,
|
||||
paused: true,
|
||||
interactive: false,
|
||||
host: "127.0.0.1",
|
||||
token: "fn_abc123",
|
||||
tokenOnly: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("routes daemon command with default port 0 for random assignment", async () => {
|
||||
await runBin(["daemon"]);
|
||||
|
||||
expect(runDaemon).toHaveBeenCalledWith({
|
||||
port: 0,
|
||||
paused: false,
|
||||
interactive: false,
|
||||
host: undefined,
|
||||
token: undefined,
|
||||
tokenOnly: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("routes desktop command flags", async () => {
|
||||
await runBin(["desktop", "--dev", "--paused", "--interactive"]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user