test: clarify gateway auth probe assertions · openclaw/openclaw@e6031fd
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -189,7 +189,7 @@ describe("issue #13992 regression - cron jobs skip execution", () => {
|
189 | 189 | |
190 | 190 | const state = createMockCronStateForJobs({ jobs: [dueJob, malformedJob], nowMs: now }); |
191 | 191 | |
192 | | -expect(() => recomputeNextRunsForMaintenance(state)).not.toThrow(); |
| 192 | +expect(recomputeNextRunsForMaintenance(state)).toBe(true); |
193 | 193 | expect(dueJob.state.nextRunAtMs).toBe(pastDue); |
194 | 194 | expect(malformedJob.state.nextRunAtMs).toBeUndefined(); |
195 | 195 | expect(malformedJob.state.scheduleErrorCount).toBe(1); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -19,12 +19,12 @@ describe("live-agent-probes", () => {
|
19 | 19 | }); |
20 | 20 | |
21 | 21 | it("accepts only cat for the shared image probe reply", () => { |
22 | | -expect(() => assertLiveImageProbeReply("cat")).not.toThrow(); |
23 | | -expect(() => |
| 22 | +expect(assertLiveImageProbeReply("cat")).toBeUndefined(); |
| 23 | +expect( |
24 | 24 | assertLiveImageProbeReply( |
25 | 25 | "model metadata for `gpt-5.5` not found. defaulting to fallback metadata; this can degrade performance and cause issues.cat", |
26 | 26 | ), |
27 | | -).not.toThrow(); |
| 27 | +).toBeUndefined(); |
28 | 28 | expect(() => assertLiveImageProbeReply("horse")).toThrow("image probe expected 'cat'"); |
29 | 29 | expect(() => assertLiveImageProbeReply("caterpillar")).toThrow("image probe expected 'cat'"); |
30 | 30 | }); |
@@ -77,7 +77,7 @@ describe("live-agent-probes", () => {
|
77 | 77 | }); |
78 | 78 | |
79 | 79 | it("validates cron cli job shape for the shared live probe", () => { |
80 | | -expect(() => |
| 80 | +expect( |
81 | 81 | assertCronJobMatches({ |
82 | 82 | job: { |
83 | 83 | name: "live-mcp-abc", |
@@ -90,6 +90,6 @@ describe("live-agent-probes", () => {
|
90 | 90 | expectedMessage: "probe-abc", |
91 | 91 | expectedSessionKey: "agent:dev:test", |
92 | 92 | }), |
93 | | -).not.toThrow(); |
| 93 | +).toBeUndefined(); |
94 | 94 | }); |
95 | 95 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -515,36 +515,36 @@ describe("assertGatewayAuthNotKnownWeak", () => {
|
515 | 515 | }, |
516 | 516 | ); |
517 | 517 | |
518 | | -it("does not throw on an empty token (falls through to generation path)", () => { |
519 | | -expect(() => |
| 518 | +it("allows an empty token to fall through to generation path", () => { |
| 519 | +expect( |
520 | 520 | assertGatewayAuthNotKnownWeak({ |
521 | 521 | mode: "token", |
522 | 522 | modeSource: "config", |
523 | 523 | token: "", |
524 | 524 | allowTailscale: false, |
525 | 525 | }), |
526 | | -).not.toThrow(); |
| 526 | +).toBeUndefined(); |
527 | 527 | }); |
528 | 528 | |
529 | | -it("does not throw on a real token", () => { |
530 | | -expect(() => |
| 529 | +it("allows a real token", () => { |
| 530 | +expect( |
531 | 531 | assertGatewayAuthNotKnownWeak({ |
532 | 532 | mode: "token", |
533 | 533 | modeSource: "config", |
534 | 534 | token: "a-legit-random-token-0123456789abcdef", |
535 | 535 | allowTailscale: false, |
536 | 536 | }), |
537 | | -).not.toThrow(); |
| 537 | +).toBeUndefined(); |
538 | 538 | }); |
539 | 539 | |
540 | | -it("does not throw on the none mode", () => { |
541 | | -expect(() => |
| 540 | +it("allows the none mode", () => { |
| 541 | +expect( |
542 | 542 | assertGatewayAuthNotKnownWeak({ |
543 | 543 | mode: "none", |
544 | 544 | modeSource: "default", |
545 | 545 | allowTailscale: false, |
546 | 546 | }), |
547 | | -).not.toThrow(); |
| 547 | +).toBeUndefined(); |
548 | 548 | }); |
549 | 549 | }); |
550 | 550 | |
@@ -569,7 +569,7 @@ describe("assertHooksTokenSeparateFromGatewayAuth", () => {
|
569 | 569 | }); |
570 | 570 | |
571 | 571 | it("allows hooks token when gateway auth is not token mode", () => { |
572 | | -expect(() => |
| 572 | +expect( |
573 | 573 | assertHooksTokenSeparateFromGatewayAuth({ |
574 | 574 | cfg: { |
575 | 575 | hooks: { |
@@ -584,11 +584,11 @@ describe("assertHooksTokenSeparateFromGatewayAuth", () => {
|
584 | 584 | allowTailscale: false, |
585 | 585 | }, |
586 | 586 | }), |
587 | | -).not.toThrow(); |
| 587 | +).toBeUndefined(); |
588 | 588 | }); |
589 | 589 | |
590 | 590 | it("allows matching values when hooks are disabled", () => { |
591 | | -expect(() => |
| 591 | +expect( |
592 | 592 | assertHooksTokenSeparateFromGatewayAuth({ |
593 | 593 | cfg: { |
594 | 594 | hooks: { |
@@ -603,6 +603,6 @@ describe("assertHooksTokenSeparateFromGatewayAuth", () => {
|
603 | 603 | allowTailscale: false, |
604 | 604 | }, |
605 | 605 | }), |
606 | | -).not.toThrow(); |
| 606 | +).toBeUndefined(); |
607 | 607 | }); |
608 | 608 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。