From a67c69437390c82863298bdc6d92c69cc31a6a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20D=C3=A1nyi?= Date: Mon, 27 May 2019 11:46:30 +0200 Subject: [PATCH] test: add regression tests for invalid async modifiers --- .../rules/promise-function-async.test.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 3910cea56042..13b4a18c2e8d 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -42,6 +42,29 @@ class Test { public async asyncPromiseMethodB() { return new Promise(); } +} + `, + ` +class InvalidAsyncModifiers { + public constructor() { + return new Promise(); + } + public get asyncGetter() { + return new Promise(); + } + public set asyncGetter(p: Promise) { + return p; + } +} + `, + ` +const invalidAsyncModifiers = { + get asyncGetter() { + return new Promise(); + }, + set asyncGetter(p: Promise) { + return p; + } } `, // https://github.com/typescript-eslint/typescript-eslint/issues/227