diff --git a/lib/rules/no-synchronous-tests.js b/lib/rules/no-synchronous-tests.js index e6bca53..80174fc 100644 --- a/lib/rules/no-synchronous-tests.js +++ b/lib/rules/no-synchronous-tests.js @@ -26,7 +26,7 @@ function doesReturnPromise(functionExpression) { if (bodyStatement.type === 'BlockStatement') { returnStatement = findPromiseReturnStatement(functionExpression.body.body); - } else if (bodyStatement.type === 'CallExpression') { + } else if (bodyStatement.type !== 'Literal') { // allow arrow statements calling a promise with implicit return. returnStatement = bodyStatement; } diff --git a/test/rules/no-synchronous-tests.js b/test/rules/no-synchronous-tests.js index 840add6..865cf85 100644 --- a/test/rules/no-synchronous-tests.js +++ b/test/rules/no-synchronous-tests.js @@ -41,6 +41,10 @@ ruleTester.run('no-synchronous-tests', rules['no-synchronous-tests'], { code: 'it("", () => promise() );', parserOptions: { ecmaVersion: 6 } }, + { + code: 'it("", () => promise );', + parserOptions: { ecmaVersion: 6 } + }, { code: 'it("", () => promise.then() );', parserOptions: { ecmaVersion: 6 }