hunk.code_window:       errorMap: () => ({ message: "OVERRIDE" }),
       });
     }).toThrow();
   });
   // test("dont short circuit on continuable errors", () => {
   //   const user = z
   //     .object({
  
hunk.labels: keep keep keep keep add keep keep keep
hunk.after_edit: test("strict error message", () => {
     const errorMsg = "Invalid object";
     const obj = z.object({ x: z.string() }).strict(errorMsg);
     const result = obj.safeParse({ x: "a", y: "b" });
     expect(result.success).toEqual(false);
     if (!result.success) {
       expect(result.error.issues[0].message).toEqual(errorMsg);
     }
   });
  
hunk.file_path: deno/lib/__tests__/error.test.ts
hunk.type: add
file: // @ts-ignore TS6133
  import { expect, test } from "@jest/globals";
  
  import { util } from "../helpers/util";
  import * as z from "../index";
  
  const booleanRecord = z.record(z.boolean());
  type booleanRecord = z.infer<typeof booleanRecord>;
  
  const recordWithEnumKeys = z.record(z.enum(["Tuna", "Salmon"]), z.string());
  type recordWithEnumKeys = z.infer<typeof recordWithEnumKeys>;
  
  const recordWithLiteralKeys = z.record(
    z.union([z.literal("Tuna"), z.literal("Salmon")]),
    z.string()
  );
  type recordWithLiteralKeys = z.infer<typeof recordWithLiteralKeys>;
  
  test("type inference", () => {
    const f1: util.AssertEqual<booleanRecord, Record<string, boolean>> = true;
    f1;
  
    const f2: util.AssertEqual<
      recordWithEnumKeys,
      Record<"Tuna" | "Salmon", string>
    > = true;
    f2;
    const f3: util.AssertEqual<
      recordWithLiteralKeys,
      Record<"Tuna" | "Salmon", string>
    > = true;
    f3;
  });
  
  test("methods", () => {
    booleanRecord.optional();
    booleanRecord.nullable();
  });
  
  test("string record parse - pass", () => {
    booleanRecord.parse({
      k1: true,
      k2: false,
      1234: false,
    });
  });
  
  test("string record parse - fail", () => {
    const badCheck = () =>
      booleanRecord.parse({
        asdf: 1234,
      } as any);
    expect(badCheck).toThrow();
  
    expect(() => booleanRecord.parse("asdf")).toThrow();
  });
  
  test("string record parse - fail", () => {
    const badCheck = () =>
      booleanRecord.parse({
        asdf: {},
      } as any);
    expect(badCheck).toThrow();
  });
  
  test("string record parse - fail", () => {
    const badCheck = () =>
      booleanRecord.parse({
        asdf: [],
      } as any);
    expect(badCheck).toThrow();
  });
  
  test("key schema", () => {
    const result1 = recordWithEnumKeys.parse({
      Tuna: "asdf",
      Salmon: "asdf",
    });
    expect(result1).toEqual({
      Tuna: "asdf",
      Salmon: "asdf",
    });
  
    const result2 = recordWithLiteralKeys.parse({
      Tuna: "asdf",
      Salmon: "asdf",
    });
    expect(result2).toEqual({
      Tuna: "asdf",
      Salmon: "asdf",
    });
  
    expect(() =>
      recordWithEnumKeys.parse({
        Tuna: "asdf",
        Salmon: "asdf",
        Trout: "asdf",
      })
    ).toThrow();
  
    expect(() =>
      recordWithLiteralKeys.parse({
        Tuna: "asdf",
        Salmon: "asdf",
  
        Trout: "asdf",
      })
    ).toThrow();
  });
  
  // test("record element", () => {
  //   expect(booleanRecord.element).toBeInstanceOf(z.ZodBoolean);
  // });
  