test: guard browser dispatcher assertions · openclaw/openclaw@60cdb99
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
File tree
extensions/browser/src/browser
| Original file line number | Diff line number | Diff line change |
|---|
@@ -147,7 +147,9 @@ describe("pw-session getPageForTargetId", () => {
|
147 | 147 | expect(fetchInit?.headers).toEqual({}); |
148 | 148 | expect(fetchInit?.redirect).toBe("manual"); |
149 | 149 | expect(fetchInit?.signal).toBeInstanceOf(AbortSignal); |
150 | | -expect(fetchInit?.dispatcher).toBeDefined(); |
| 150 | +if (fetchInit?.dispatcher === undefined) { |
| 151 | +throw new Error("expected extension fallback fetch dispatcher"); |
| 152 | +} |
151 | 153 | } finally { |
152 | 154 | fetchSpy.mockRestore(); |
153 | 155 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -309,6 +309,8 @@ describe("browser remote profile fallback and attachOnly behavior", () => {
|
309 | 309 | expect(fetchInit.headers).toEqual({}); |
310 | 310 | expect(fetchInit.redirect).toBe("manual"); |
311 | 311 | expect(fetchInit.signal).toBeInstanceOf(AbortSignal); |
312 | | -expect(fetchInit.dispatcher).toBeDefined(); |
| 312 | +if (fetchInit.dispatcher === undefined) { |
| 313 | +throw new Error("expected remote browser fetch dispatcher"); |
| 314 | +} |
313 | 315 | }); |
314 | 316 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。