Socket
Socket
Sign inDemoInstall

eslint-plugin-cypress

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-cypress - npm Package Compare versions

Comparing version 2.7.0 to 2.8.0

19

lib/rules/no-unnecessary-waiting.js

@@ -24,4 +24,8 @@ /**

CallExpression (node) {
if (isCallingCyWait(node) && isNumberArgument(node)) {
context.report({ node, messageId: 'unexpected' })
if (isCallingCyWait(node)) {
const scope = context.getScope()
if (isIdentifierNumberConstArgument(node, scope) || isNumberArgument(node)) {
context.report({ node, messageId: 'unexpected' })
}
}

@@ -46,1 +50,12 @@ },

}
function isIdentifierNumberConstArgument (node, scope) {
if (node.arguments[0].type !== 'Identifier') {
return false
}
const resolvedIdentifier = scope.resolve(node.arguments[0]).resolved
const IdentifierValue = resolvedIdentifier.defs[0].node.init.value
return typeof IdentifierValue === 'number'
}

2

package.json
{
"name": "eslint-plugin-cypress",
"version": "2.7.0",
"version": "2.8.0",
"description": "An ESLint plugin for projects using Cypress",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -21,2 +21,4 @@ 'use strict'

{ code: 'cy.tick(500)', parserOptions },
{ code: 'const someRequest="@someRequest"; cy.wait(someRequest)', parserOptions, errors },
],

@@ -28,3 +30,4 @@

{ code: 'cy.wait(5000)', parserOptions, errors },
{ code: 'const someNumber=500; cy.wait(someNumber)', parserOptions, errors },
],
})

@@ -11,3 +11,3 @@ 'use strict'

ruleTester.run('no-dynamic-id-classes', rule, {
ruleTester.run('require-data-selectors', rule, {
valid: [

@@ -14,0 +14,0 @@ { code: 'cy.get(\'[data-cy=submit]\').click()', parserOptions },

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