test: check bonjour warning messages · openclaw/openclaw@2a53725
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -748,13 +748,16 @@ describe("gateway bonjour advertiser", () => {
|
748 | 748 | |
749 | 749 | expect(advertise).toHaveBeenCalledTimes(1); |
750 | 750 | expect(createService).toHaveBeenCalledTimes(1); |
751 | | -expect(logger.warn).not.toHaveBeenCalledWith( |
752 | | -expect.stringContaining("watchdog detected non-announced service; attempting re-advertise"), |
| 751 | +expect( |
| 752 | +warnMessages().every( |
| 753 | +(message) => |
| 754 | +!message.includes("watchdog detected non-announced service; attempting re-advertise"), |
| 755 | +), |
753 | 756 | ); |
754 | 757 | |
755 | 758 | await vi.advanceTimersByTimeAsync(10_000); |
756 | 759 | |
757 | | -expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining("service stuck in probing")); |
| 760 | +expectWarnContaining("service stuck in probing"); |
758 | 761 | expect(createService).toHaveBeenCalledTimes(2); |
759 | 762 | |
760 | 763 | await started.stop(); |
@@ -781,13 +784,11 @@ describe("gateway bonjour advertiser", () => {
|
781 | 784 | await vi.advanceTimersByTimeAsync(15_000); |
782 | 785 | |
783 | 786 | expect(createService).toHaveBeenCalledTimes(1); |
784 | | -expect(logger.warn).toHaveBeenCalledWith( |
785 | | -expect.stringContaining('name conflict resolved; newName="test-host (OpenClaw) (2)"'), |
786 | | -); |
| 787 | +expectWarnContaining('name conflict resolved; newName="test-host (OpenClaw) (2)"'); |
787 | 788 | |
788 | 789 | await vi.advanceTimersByTimeAsync(20_000); |
789 | 790 | |
790 | | -expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining("service stuck in probing")); |
| 791 | +expectWarnContaining("service stuck in probing"); |
791 | 792 | expect(createService).toHaveBeenCalledTimes(2); |
792 | 793 | |
793 | 794 | await started.stop(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。