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;