test(replay-ui): exercise real URL encoding and non-ok throw in getJson

This commit is contained in:
pj committed 2026-06-06 13:07:43 +05:30
1 parent 0fae65d4f2
commit 8f817bd8ff
2 files changed
+32 -5

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
import type { Run, RunSummary, Step } from "./types";
async function getJson<T>(path: string): Promise<T> {
export async function getJson<T>(path: string): Promise<T> {
const response = await fetch(path, { headers: { Accept: "application/json" } });
if (!response.ok) {
throw new Error(`request failed: ${response.status} ${response.statusText} (${path})`);