From 96d4557ecde6e7cedc60cf9fa6486aa19ffce841 Mon Sep 17 00:00:00 2001 From: Zak Angelle Date: Fri, 30 Nov 2018 12:53:15 -0600 Subject: [PATCH] yup: Add resolve type to TestContext --- types/yup/index.d.ts | 1 + types/yup/yup-tests.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index 821b0e3526..7d93dd3326 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -206,6 +206,7 @@ export interface TestContext { options: ValidateOptions; parent: any; schema: Schema; + resolve: (value: any) => any; createError: (params: { path: string; message: string }) => ValidationError; } diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index efef78d319..b4dedc6bcb 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -174,6 +174,8 @@ const testContext = function(this: TestContext) { this.parent; // $ExpectType Schema this.schema; + // $ExpectType (value: any) => any + this.resolve; // $ExpectType ValidationError this.createError({ path: "1", message: "1" }); return true;