Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-cucumber

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-cucumber - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

7

lib/rules/async-then.js

@@ -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(

4

package.json
{
"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";})',

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc