Prepare verified laboratory 7 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:32:06 +03:00
parent 20afc2c790
commit eb1b5c7b84
677 changed files with 208256 additions and 64 deletions
@@ -0,0 +1,19 @@
import { expect, test } from "bun:test";
import { parseOpenObserveResponse } from "../scripts/openobserve-response";
for (const status of [401, 422, 500])
test(`HTTP${status} text error preserves native HTTP outcome`, () => {
expect(parseOpenObserveResponse(status, "Query deserialize error")).toEqual(
{ status, data: null },
);
});
test("HTTP200 JSON remains parsed", () => {
expect(parseOpenObserveResponse(200, '{"code":200}')).toEqual({
status: 200,
data: { code: 200 },
});
});
test("HTTP200 malformed success retains the status in its error", () => {
expect(() => parseOpenObserveResponse(200, "invalid")).toThrow(
"OPENOBSERVE_HTTP_200_INVALID_JSON",
);
});