test: tighten browser cli lazy assertions · openclaw/openclaw@81c4862
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -108,7 +108,7 @@ describe("registerBrowserCli lazy browser subcommands", () => {
|
108 | 108 | expect(manageMocks.registerBrowserManageCommands).toHaveBeenCalledTimes(1); |
109 | 109 | expect(debugMocks.registerBrowserDebugCommands).not.toHaveBeenCalled(); |
110 | 110 | expect(manageMocks.doctorAction).toHaveBeenCalledTimes(1); |
111 | | -expect(manageMocks.doctorAction.mock.calls[0]?.[0]).toMatchObject({ deep: true }); |
| 111 | +expect(manageMocks.doctorAction.mock.calls[0]?.[0]?.deep).toBe(true); |
112 | 112 | }); |
113 | 113 | |
114 | 114 | it("preserves parent --json while reparsing lazy manage commands", async () => { |
@@ -121,7 +121,7 @@ describe("registerBrowserCli lazy browser subcommands", () => {
|
121 | 121 | |
122 | 122 | expect(manageMocks.openAction).toHaveBeenCalledTimes(1); |
123 | 123 | const openCommand = manageMocks.openAction.mock.calls[0]?.at(-1) as Command | undefined; |
124 | | -expect(openCommand?.parent?.opts()).toMatchObject({ json: true }); |
| 124 | +expect(openCommand?.parent?.opts().json).toBe(true); |
125 | 125 | |
126 | 126 | const tabsProgram = new Command(); |
127 | 127 | tabsProgram.name("openclaw"); |
@@ -131,7 +131,7 @@ describe("registerBrowserCli lazy browser subcommands", () => {
|
131 | 131 | |
132 | 132 | expect(manageMocks.tabsAction).toHaveBeenCalledTimes(1); |
133 | 133 | const tabsCommand = manageMocks.tabsAction.mock.calls[0]?.at(-1) as Command | undefined; |
134 | | -expect(tabsCommand?.parent?.opts()).toMatchObject({ json: true }); |
| 134 | +expect(tabsCommand?.parent?.opts().json).toBe(true); |
135 | 135 | }); |
136 | 136 | |
137 | 137 | it("can eagerly register all browser groups for compatibility", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。