fix(FN-000): address startup review feedback
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
buildForwardedDevArgs,
|
||||
buildDevNodeArgs,
|
||||
getPrebuildCommand,
|
||||
normalizePrebuildMode,
|
||||
parseDevWrapperArgs,
|
||||
resolvePrebuildMode,
|
||||
} from "../../../../scripts/dev-with-memory-lib.mjs";
|
||||
@@ -45,6 +47,28 @@ describe("dev-with-memory prebuild options", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("rejects explicit empty prebuild modes", () => {
|
||||
expect(() => normalizePrebuildMode("")).toThrow(/Invalid prebuild mode/);
|
||||
expect(() => parseDevWrapperArgs(["--prebuild=", "dashboard"], {})).toThrow(/Invalid prebuild mode/);
|
||||
});
|
||||
|
||||
it("does not inject a dev host when --host=value is already present", () => {
|
||||
expect(buildForwardedDevArgs(["dashboard", "--host=127.0.0.1"])).toEqual([
|
||||
"dashboard",
|
||||
"--host=127.0.0.1",
|
||||
]);
|
||||
});
|
||||
|
||||
it("injects a LAN-reachable dev host for dashboard startup without a host override", () => {
|
||||
expect(buildForwardedDevArgs(["dashboard", "--port", "4050"])).toEqual([
|
||||
"dashboard",
|
||||
"--port",
|
||||
"4050",
|
||||
"--host",
|
||||
"0.0.0.0",
|
||||
]);
|
||||
});
|
||||
|
||||
it("defaults dashboard startup to client-only prebuild instead of full workspace build", () => {
|
||||
expect(resolvePrebuildMode("auto", ["dashboard", "--port", "4050"])).toBe("client");
|
||||
expect(getPrebuildCommand("client")).toEqual({
|
||||
|
||||
@@ -166,10 +166,15 @@ async function flushFrames() {
|
||||
await Promise.resolve();
|
||||
}
|
||||
|
||||
async function focusSettingsDetailPane(stdin: { write: (chunk: string) => void }, lastFrame: () => string | undefined) {
|
||||
stdin.write("\u001b[C");
|
||||
async function waitForFrameUpdateAfterInput() {
|
||||
// Ink can schedule the frame triggered by stdin on the next timer tick.
|
||||
await new Promise((resolve) => setTimeout(resolve, 25));
|
||||
await flushFrames();
|
||||
}
|
||||
|
||||
async function focusSettingsDetailPane(stdin: { write: (chunk: string) => void }, lastFrame: () => string | undefined) {
|
||||
stdin.write("\u001b[C");
|
||||
await waitForFrameUpdateAfterInput();
|
||||
await waitForFrameContains(lastFrame, "[C/V/X/P/L/U/K/R] remote actions");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user