test: fix readonly typing regressions in check baseline

This commit is contained in:
Brian Mendonca
2026-02-21 15:11:56 -07:00
committed by Peter Steinberger
parent 0e1aa77928
commit c7c047287e
5 changed files with 39 additions and 16 deletions

View File

@@ -411,14 +411,16 @@ describe("redactConfigSnapshot", () => {
const cfg = redacted as Record<string, Record<string, unknown>>;
const cfgCustom2 = cfg.custom2 as unknown as unknown[];
expect(cfgCustom2.length).toBeGreaterThan(0);
expect((cfg.custom1.anykey as Record<string, unknown>).mySecret).toBe(REDACTED_SENTINEL);
expect(
((cfg.custom1 as Record<string, unknown>).anykey as Record<string, unknown>).mySecret,
).toBe(REDACTED_SENTINEL);
expect((cfgCustom2[0] as Record<string, unknown>).mySecret).toBe(REDACTED_SENTINEL);
const out = restored as Record<string, Record<string, unknown>>;
const outCustom2 = out.custom2 as unknown as unknown[];
expect(outCustom2.length).toBeGreaterThan(0);
expect((out.custom1.anykey as Record<string, unknown>).mySecret).toBe(
"this-is-a-custom-secret-value",
);
expect(
((out.custom1 as Record<string, unknown>).anykey as Record<string, unknown>).mySecret,
).toBe("this-is-a-custom-secret-value");
expect((outCustom2[0] as Record<string, unknown>).mySecret).toBe(
"this-is-a-custom-secret-value",
);
@@ -438,14 +440,16 @@ describe("redactConfigSnapshot", () => {
const cfg = redacted as Record<string, Record<string, unknown>>;
const cfgCustom2 = cfg.custom2 as unknown as unknown[];
expect(cfgCustom2.length).toBeGreaterThan(0);
expect((cfg.custom1.anykey as Record<string, unknown>).mySecret).toBe(REDACTED_SENTINEL);
expect(
((cfg.custom1 as Record<string, unknown>).anykey as Record<string, unknown>).mySecret,
).toBe(REDACTED_SENTINEL);
expect((cfgCustom2[0] as Record<string, unknown>).mySecret).toBe(REDACTED_SENTINEL);
const out = restored as Record<string, Record<string, unknown>>;
const outCustom2 = out.custom2 as unknown as unknown[];
expect(outCustom2.length).toBeGreaterThan(0);
expect((out.custom1.anykey as Record<string, unknown>).mySecret).toBe(
"this-is-a-custom-secret-value",
);
expect(
((out.custom1 as Record<string, unknown>).anykey as Record<string, unknown>).mySecret,
).toBe("this-is-a-custom-secret-value");
expect((outCustom2[0] as Record<string, unknown>).mySecret).toBe(
"this-is-a-custom-secret-value",
);