Files
reverse-engineering-anything/tests/fixtures/fetchWebSourceMapsOk.ts
T
morluto 10b83a9b62 fix(browser): preserve completed source-map observations
Return typed fetch outcomes with completed map coverage when acquisition is
cancelled or a response resource fails. Compose those facts with the captured
inspection as partial bundle Evidence, preserving exclusions, exact abort causes,
and cleanup priority without claiming unperformed script analysis.

Keep complete response-body SHA-256 and byte counts when map interpretation
fails, while preserving compact failure rows and capacity for later valid maps.
Reuse the read owner digest for successful text artifacts and preflight their
JSON representation before parsing. Historical failed rows remain importable.

Exercise controlled HTTP/stream boundaries, CLI SIGINT, and SDK cancellation
with later MCP Evidence retrieval. Share the public cancellation fixture and
use one Result API across consumers. Real Chromium and Windows CLI cancellation
were not verified.
2026-10-25 05:09:26 +08:00

12 lines
480 B
TypeScript

import { fetchWebSourceMaps } from "../../src/browser/WebSourceMapFetcher.js";
import type { WebSourceMaps } from "../../src/domain/webBundleAnalysis.js";
/** Assert the successful producer branch in tests of completed map collections. */
export const fetchWebSourceMapsOk = async (
...args: Parameters<typeof fetchWebSourceMaps>
): Promise<WebSourceMaps> => {
const result = await fetchWebSourceMaps(...args);
if (!result.ok) throw result.error;
return result.value;
};