test: clear nostr broad matchers · openclaw/openclaw@e8b7f5f
shakkernerd
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -298,7 +298,23 @@ describe("Metrics fuzz", () => {
|
298 | 298 | expect(metrics.emit("relay.connect", 1, { relay: longUrl })).toBeUndefined(); |
299 | 299 | |
300 | 300 | const snapshot = metrics.getSnapshot(); |
301 | | -expect(snapshot.relays[longUrl]).toEqual(expect.objectContaining({ connects: 1 })); |
| 301 | +expect(snapshot.relays[longUrl]).toEqual({ |
| 302 | +connects: 1, |
| 303 | +disconnects: 0, |
| 304 | +reconnects: 0, |
| 305 | +errors: 0, |
| 306 | +messagesReceived: { |
| 307 | +event: 0, |
| 308 | +eose: 0, |
| 309 | +closed: 0, |
| 310 | +notice: 0, |
| 311 | +ok: 0, |
| 312 | +auth: 0, |
| 313 | +}, |
| 314 | +circuitBreakerState: "closed", |
| 315 | +circuitBreakerOpens: 0, |
| 316 | +circuitBreakerCloses: 0, |
| 317 | +}); |
302 | 318 | }); |
303 | 319 | }); |
304 | 320 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -430,7 +430,7 @@ describe("nostr-profile-http", () => {
|
430 | 430 | // The schema validation catches non-https URLs before SSRF check |
431 | 431 | expect(data.error).toBe("Validation failed"); |
432 | 432 | expect(Array.isArray(data.details)).toBe(true); |
433 | | -expect(data.details).toEqual(expect.arrayContaining([expect.stringContaining("https")])); |
| 433 | +expect(data.details).toEqual(["picture: URL must use https:// protocol"]); |
434 | 434 | }); |
435 | 435 | |
436 | 436 | it("does not persist if all relays fail", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -223,7 +223,7 @@ describe("validateProfile", () => {
|
223 | 223 | const result = validateProfile(profile); |
224 | 224 | |
225 | 225 | expect(result.valid).toBe(false); |
226 | | -expect(result.errors).toEqual(expect.arrayContaining([expect.stringContaining("https://")])); |
| 226 | +expect(result.errors).toEqual(["picture: URL must use https:// protocol"]); |
227 | 227 | }); |
228 | 228 | |
229 | 229 | it("rejects profile with javascript: URL", () => { |
@@ -256,7 +256,7 @@ describe("validateProfile", () => {
|
256 | 256 | const result = validateProfile(profile); |
257 | 257 | |
258 | 258 | expect(result.valid).toBe(false); |
259 | | -expect(result.errors).toEqual(expect.arrayContaining([expect.stringContaining("256")])); |
| 259 | +expect(result.errors).toEqual(["name: Too big: expected string to have <=256 characters"]); |
260 | 260 | }); |
261 | 261 | |
262 | 262 | it("rejects about exceeding 2000 characters", () => { |
@@ -267,7 +267,7 @@ describe("validateProfile", () => {
|
267 | 267 | const result = validateProfile(profile); |
268 | 268 | |
269 | 269 | expect(result.valid).toBe(false); |
270 | | -expect(result.errors).toEqual(expect.arrayContaining([expect.stringContaining("2000")])); |
| 270 | +expect(result.errors).toEqual(["about: Too big: expected string to have <=2000 characters"]); |
271 | 271 | }); |
272 | 272 | |
273 | 273 | it("accepts empty profile", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。