From 13d9e6bda286cbd4c1b177171273695d8309e5de Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Tue, 15 Aug 2023 12:45:00 -0700 Subject: [PATCH] Fix lint --- deno/lib/__tests__/function.test.ts | 16 ++++++++++------ src/__tests__/function.test.ts | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/deno/lib/__tests__/function.test.ts b/deno/lib/__tests__/function.test.ts index 45031fb09..675891e6d 100644 --- a/deno/lib/__tests__/function.test.ts +++ b/deno/lib/__tests__/function.test.ts @@ -32,27 +32,31 @@ test("function inference 1", () => { test("method parsing", () => { const methodObject = z.object({ property: z.number(), - method: z.function().args(z.string()).returns(z.number()) + method: z.function().args(z.string()).returns(z.number()), }); const methodInstance = { property: 3, - method: function(s: string) { return s.length + this.property; } + method: function (s: string) { + return s.length + this.property; + }, }; const parsed = methodObject.parse(methodInstance); - expect(parsed.method('length=8')).toBe(11); // 8 length + 3 property + expect(parsed.method("length=8")).toBe(11); // 8 length + 3 property }); test("async method parsing", async () => { const methodObject = z.object({ property: z.number(), - method: z.function().args(z.string()).returns(z.promise(z.number())) + method: z.function().args(z.string()).returns(z.promise(z.number())), }); const methodInstance = { property: 3, - method: async function(s: string) { return s.length + this.property; } + method: async function (s: string) { + return s.length + this.property; + }, }; const parsed = methodObject.parse(methodInstance); - expect(await parsed.method('length=8')).toBe(11); // 8 length + 3 property + expect(await parsed.method("length=8")).toBe(11); // 8 length + 3 property }); test("args method", () => { diff --git a/src/__tests__/function.test.ts b/src/__tests__/function.test.ts index b6a572700..1c23cb9c5 100644 --- a/src/__tests__/function.test.ts +++ b/src/__tests__/function.test.ts @@ -31,27 +31,31 @@ test("function inference 1", () => { test("method parsing", () => { const methodObject = z.object({ property: z.number(), - method: z.function().args(z.string()).returns(z.number()) + method: z.function().args(z.string()).returns(z.number()), }); const methodInstance = { property: 3, - method: function(s: string) { return s.length + this.property; } + method: function (s: string) { + return s.length + this.property; + }, }; const parsed = methodObject.parse(methodInstance); - expect(parsed.method('length=8')).toBe(11); // 8 length + 3 property + expect(parsed.method("length=8")).toBe(11); // 8 length + 3 property }); test("async method parsing", async () => { const methodObject = z.object({ property: z.number(), - method: z.function().args(z.string()).returns(z.promise(z.number())) + method: z.function().args(z.string()).returns(z.promise(z.number())), }); const methodInstance = { property: 3, - method: async function(s: string) { return s.length + this.property; } + method: async function (s: string) { + return s.length + this.property; + }, }; const parsed = methodObject.parse(methodInstance); - expect(await parsed.method('length=8')).toBe(11); // 8 length + 3 property + expect(await parsed.method("length=8")).toBe(11); // 8 length + 3 property }); test("args method", () => {