test(browser): cover SAZ capture-level null member limitation

This commit is contained in:
morluto
2026-10-24 06:29:22 +08:00
parent 3472cc4570
commit dbf8e1eacc
2 changed files with 14 additions and 2 deletions
@@ -2,6 +2,13 @@ import { expect, it, vi } from "vitest";
import { AnalysisCapabilityUnavailableError } from "../../domain/analysisErrorCore.js";
import { NodeCaptureAdapter } from "./NodeCaptureAdapter.js";
it.each(["har", "qlog"] as const)(
"keeps SAZ-specific limitations out of %s captures",
(format) => {
expect(new NodeCaptureAdapter(format).limitations).toEqual([]);
},
);
vi.mock("./CaptureRelease.js", async (original) => ({
...(await original<typeof import("./CaptureRelease.js")>()),
NODE_CAPTURE_HEAP_ENFORCED: false,
+7 -2
View File
@@ -640,13 +640,18 @@ it("reports zero-byte SAZ HTTP members as null instead of rejecting the archive"
(await cli(path)).normalized_result,
);
expect(capture.total_records).toBe(2);
expect(capture.limitations).toContainEqual(
expect.stringMatching(
/\babsent\b[^.]*\bzero-byte\b[^.]*\bHTTP members\b[^.]*\bnull\b/iu,
),
);
expect(capture.records[0]?.reported).toMatchObject({
request: { method: "GET" },
request: { method: "GET", body: "" },
response: null,
});
expect(capture.records[1]?.reported).toMatchObject({
request: null,
response: { status: "204" },
response: { status: "204", body: "" },
websocket: { member: "raw/2_w.txt" },
});
expect(capture.records[0]?.location).toEqual({