diff --git a/package.json b/package.json index e5b43b5..9f236ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@youngapp/yap", - "version": "1.15.0", + "version": "1.16.0", "description": "Yap Core", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", diff --git a/src/connectors/connector.ts b/src/connectors/connector.ts index 6557ffc..f4842c1 100644 --- a/src/connectors/connector.ts +++ b/src/connectors/connector.ts @@ -34,14 +34,14 @@ export default class Connector { /** * Test function */ - public test() { + public async test() { throw new Error("Method validate is not implemented"); } /** * Execute function */ - public execute(parent: any, args: any, context: Context, info: any) { + public async execute(parent: any, args: any, context: Context, info: any):Promise { throw new Error("Method validate is not implemented"); } diff --git a/test/index.test.ts b/test/index.test.ts index 92a5e08..23af37f 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -39,7 +39,7 @@ describe('Core', () => { }) class TestConnector extends Connector { public async execute(parent: any, args: any, context: Context, info: any) { - return new Promise(res => res(result)); + return await new Promise(res => res(result)); } } @YapConnector({ @@ -49,7 +49,7 @@ describe('Core', () => { description: "testDescription" }) class TestErrorConnector extends Connector { - public execute(parent: any, args: any, context: Context, info: any) { + public async execute(parent: any, args: any, context: Context, info: any) { throw new Error("Some error"); } }