From 9bd71f3bdd3343f2ea1398eb55570540d84dff70 Mon Sep 17 00:00:00 2001 From: Fernando Lisboa Costa Date: Tue, 20 Feb 2024 03:17:54 -0300 Subject: [PATCH] style: lint with prettier --- deno/lib/__tests__/enum.test.ts | 18 +++++++++++++----- src/__tests__/enum.test.ts | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/deno/lib/__tests__/enum.test.ts b/deno/lib/__tests__/enum.test.ts index 964a38215..819d3264f 100644 --- a/deno/lib/__tests__/enum.test.ts +++ b/deno/lib/__tests__/enum.test.ts @@ -59,19 +59,27 @@ test("extract/exclude", () => { util.assertEqual, never>(true); }); -test('error map in extract/exclude', () => { +test("error map in extract/exclude", () => { const foods = ["Pasta", "Pizza", "Tacos", "Burgers", "Salad"] as const; - const FoodEnum = z.enum(foods, { errorMap: () => ({ message: "This is not food!" }) }); + const FoodEnum = z.enum(foods, { + errorMap: () => ({ message: "This is not food!" }), + }); const ItalianEnum = FoodEnum.extract(["Pasta", "Pizza"]); const foodsError = FoodEnum.safeParse("Cucumbers"); const italianError = ItalianEnum.safeParse("Tacos"); if (!foodsError.success && !italianError.success) { - expect(foodsError.error.issues[0].message).toEqual(italianError.error.issues[0].message); + expect(foodsError.error.issues[0].message).toEqual( + italianError.error.issues[0].message + ); } - const UnhealthyEnum = FoodEnum.exclude(["Salad"], { errorMap: () => ({ message: "This is not healthy food!" }) }); + const UnhealthyEnum = FoodEnum.exclude(["Salad"], { + errorMap: () => ({ message: "This is not healthy food!" }), + }); const unhealthyError = UnhealthyEnum.safeParse("Salad"); if (!unhealthyError.success) { - expect(unhealthyError.error.issues[0].message).toEqual("This is not healthy food!"); + expect(unhealthyError.error.issues[0].message).toEqual( + "This is not healthy food!" + ); } }); diff --git a/src/__tests__/enum.test.ts b/src/__tests__/enum.test.ts index 013be916f..e529e9ce4 100644 --- a/src/__tests__/enum.test.ts +++ b/src/__tests__/enum.test.ts @@ -58,19 +58,27 @@ test("extract/exclude", () => { util.assertEqual, never>(true); }); -test('error map in extract/exclude', () => { +test("error map in extract/exclude", () => { const foods = ["Pasta", "Pizza", "Tacos", "Burgers", "Salad"] as const; - const FoodEnum = z.enum(foods, { errorMap: () => ({ message: "This is not food!" }) }); + const FoodEnum = z.enum(foods, { + errorMap: () => ({ message: "This is not food!" }), + }); const ItalianEnum = FoodEnum.extract(["Pasta", "Pizza"]); const foodsError = FoodEnum.safeParse("Cucumbers"); const italianError = ItalianEnum.safeParse("Tacos"); if (!foodsError.success && !italianError.success) { - expect(foodsError.error.issues[0].message).toEqual(italianError.error.issues[0].message); + expect(foodsError.error.issues[0].message).toEqual( + italianError.error.issues[0].message + ); } - const UnhealthyEnum = FoodEnum.exclude(["Salad"], { errorMap: () => ({ message: "This is not healthy food!" }) }); + const UnhealthyEnum = FoodEnum.exclude(["Salad"], { + errorMap: () => ({ message: "This is not healthy food!" }), + }); const unhealthyError = UnhealthyEnum.safeParse("Salad"); if (!unhealthyError.success) { - expect(unhealthyError.error.issues[0].message).toEqual("This is not healthy food!"); + expect(unhealthyError.error.issues[0].message).toEqual( + "This is not healthy food!" + ); } });