test(cli): repair startup progress checks

This commit is contained in:
Peter Steinberger
2026-05-17 00:51:17 +01:00
parent 97abe0f0c0
commit e19f05b79b
2 changed files with 6 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ function isBareParentDefaultHelpInvocation(actionCommand: Command, argv: string[
}
function isGuidedConfigAction(actionCommand: Command): boolean {
return actionCommand.name() === "config" && actionCommand.parent?.parent === undefined;
return actionCommand.name() === "config" && !actionCommand.parent?.parent;
}
export function registerPreActionHooks(program: Command, programVersion: string) {

View File

@@ -1400,6 +1400,9 @@ describe("run-node script", () => {
it("shows tty progress while rebuilding source-checkout artifacts", async () => {
await withTempDir({ prefix: "openclaw-run-node-" }, async (tmp) => {
await setupTrackedProject(tmp, {
files: {
[ROOT_SRC]: "export const value = 1;\n",
},
oldPaths: [ROOT_SRC, ROOT_TSCONFIG, ROOT_PACKAGE],
buildPaths: [DIST_ENTRY, BUILD_STAMP],
});
@@ -1407,7 +1410,7 @@ describe("run-node script", () => {
const stderrChunks: string[] = [];
const stderr = {
isTTY: true,
write: vi.fn((chunk: string) => {
write: vi.fn((chunk: string | Buffer) => {
stderrChunks.push(String(chunk));
return true;
}),
@@ -1430,7 +1433,7 @@ describe("run-node script", () => {
runRuntimePostBuild: async () => {},
execPath: process.execPath,
platform: process.platform,
});
} as Parameters<typeof runNodeMain>[0] & { stdout: NodeJS.WriteStream });
expect(exitCode).toBe(0);
const stderrText = stderrChunks.join("");