From 5cafea5ebee71971c0739b0c01863d6c81c7480f Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sun, 8 Nov 2026 00:06:55 +0800 Subject: [PATCH] test: clarify inspector coverage limitations --- .../JavaScriptRuntimeScope.cancellation.test.ts | 9 ++++++--- src/inspector/V8InspectorCaptureProjection.test.ts | 12 ++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/inspector/JavaScriptRuntimeScope.cancellation.test.ts b/src/inspector/JavaScriptRuntimeScope.cancellation.test.ts index ef1faf1c6f..2beed047f3 100644 --- a/src/inspector/JavaScriptRuntimeScope.cancellation.test.ts +++ b/src/inspector/JavaScriptRuntimeScope.cancellation.test.ts @@ -148,7 +148,9 @@ it("stops Inspector target authorization after the current stat settles", async complete: false, targets_examined: 1, limitations: expect.arrayContaining([ - "Cancellation stopped target authorization; unexamined targets are unknown, not excluded.", + expect.stringMatching( + /cancellation.*authorization.*unexamined targets.*unknown.*not excluded/iu, + ), ]), }, }); @@ -185,8 +187,9 @@ it("stops Electron target authorization after the current stat settles", async ( expect(result.error.cause).toBe(reason); expect(result.error.diagnostics).toMatchObject({ completed_prefix: { - coverage: - "partial: target authorization stopped; remaining targets are unknown", + coverage: expect.stringMatching( + /partial.*authorization stopped.*targets are unknown/iu, + ), }, }); const prefix = record(record(result.error.diagnostics)?.completed_prefix); diff --git a/src/inspector/V8InspectorCaptureProjection.test.ts b/src/inspector/V8InspectorCaptureProjection.test.ts index ccfe9c4710..8b88d6565f 100644 --- a/src/inspector/V8InspectorCaptureProjection.test.ts +++ b/src/inspector/V8InspectorCaptureProjection.test.ts @@ -266,8 +266,10 @@ it("preserves raw script facts without authorizing locations in partial projecti origin: "file:///slow-or-unavailable.js?token=retained", }, ]); - expect(result.unknowns).toContain( - "2 observed script locations remain unverified; raw URLs and script metadata are retained.", + expect(result.unknowns).toContainEqual( + expect.stringMatching( + /2 observed script locations.*unverified.*raw URLs.*metadata.*retained/iu, + ), ); }); @@ -292,8 +294,10 @@ it("counts retained unresolved script locations after deduplication in partial c }); expect(result.scripts.items).toHaveLength(1); expect(result.scripts.observed_total).toBe(2); - expect(result.unknowns).toContain( - "1 observed script location remains unverified; raw URLs and script metadata are retained.", + expect(result.unknowns).toContainEqual( + expect.stringMatching( + /1 observed script location.*unverified.*raw URLs.*metadata.*retained/iu, + ), ); });