mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-22 13:28:10 +00:00
fix(browser): remove dead requireRef navigation import
Remove the unused requireRef import and void anchor from Browser navigation command registration while keeping navigate/resize registration covered by regression tests. Fixes #83878.
This commit is contained in:
@@ -61,4 +61,18 @@ describe("browser navigation commands", () => {
|
||||
expect(capture.runtimeErrors.join("\n")).toContain("Invalid width: maximum is 8192");
|
||||
expect(mocks.runBrowserResizeWithOutput).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("navigate and resize commands are registered after removing dead import (#83878)", async () => {
|
||||
const program = createNavigationProgram();
|
||||
const browserCmd = program.commands.find((c) => c.name() === "browser");
|
||||
expect(browserCmd).toBeDefined();
|
||||
|
||||
const cmds = browserCmd!.commands.map((c) => c.name());
|
||||
expect(cmds).toContain("resize");
|
||||
expect(cmds).toContain("navigate");
|
||||
|
||||
// Verify the shared module still exports requireRef (used by other modules)
|
||||
const shared = await import("./shared.js");
|
||||
expect(typeof shared.requireRef).toBe("function");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
type BrowserParentOpts,
|
||||
} from "../browser-cli-shared.js";
|
||||
import { danger, defaultRuntime } from "../core-api.js";
|
||||
import { requireRef, resolveBrowserActionContext } from "./shared.js";
|
||||
import { resolveBrowserActionContext } from "./shared.js";
|
||||
|
||||
/** Registers Browser navigate and resize commands. */
|
||||
export function registerBrowserNavigationCommands(
|
||||
@@ -94,7 +94,4 @@ export function registerBrowserNavigationCommands(
|
||||
defaultRuntime.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
// Keep `requireRef` reachable; shared utilities are intended for other modules too.
|
||||
void requireRef;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user