eslint-plugin-cucumber
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -42,2 +42,6 @@ module.exports = function(context) { | ||
function isAsyncFunction(func) { | ||
return !!func.async; | ||
} | ||
return { | ||
@@ -48,2 +52,5 @@ CallExpression: function(node) { | ||
if (isAsyncFunction(stepBody)) { | ||
return; | ||
} | ||
if (doesNotHaveCallback(stepBody) && didNotReturnAnythingIn(stepBody)) { | ||
@@ -50,0 +57,0 @@ context.report( |
{ | ||
"name": "eslint-plugin-cucumber", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "eslint rules for cucumber steps", | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
"dependencies": { | ||
"lodash": "^4.17.10" | ||
"lodash": "^4.17.15" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
@@ -41,3 +41,3 @@ # eslint-plugin-cucumber | ||
"cucumber/no-restricted-tags": [2, "wip", "broken", "foo"], | ||
"no-arrow-functions": 2 | ||
"cucumber/no-arrow-functions": 2 | ||
} | ||
@@ -51,3 +51,3 @@ } | ||
| ------------- | ------------- | | ||
| async-then | If you assume asynchronous steps then your Then steps should either return a promise or provide a callback function | | ||
| async-then | If you assume asynchronous steps then your Then steps should either be an async function, return a promise or provide a callback function | | ||
| no-restricted-tags | Restrict usage of specified tags | | ||
@@ -54,0 +54,0 @@ | no-arrow-functions | Restrict usage of arrow functions on step definitions | |
const rule = require('../../../lib/rules/async-then'); | ||
const RuleTester = require('eslint').RuleTester; | ||
new RuleTester().run('async-then', rule, { | ||
const tester = new RuleTester({parserOptions: {ecmaVersion: '2017'}}); | ||
tester.run('async-then', rule, { | ||
valid: [ | ||
'this.Then(/step/, async function () {})', | ||
'Then(/step/, async function () {})', | ||
'this.Then(/step/, function () {return "anything";})', | ||
@@ -7,0 +11,0 @@ 'Then(/step/, function () {return "anything";})', |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20828
548
0
Updatedlodash@^4.17.15