eslint-plugin-cypress 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ const unsafeToChainActions = [
19
19
  'check',
20
20
  'dblclick',
21
21
  'each',
22
- 'focus$',
22
+ 'focus',
23
23
  'rightclick',
24
24
  'screenshot',
25
25
  'scrollIntoView',
@@ -130,7 +130,7 @@ const isRootCypress = (node) => {
130
130
  */
131
131
  const isActionUnsafeToChain = (node, additionalMethods = []) => {
132
132
  const unsafeActionsRegex = new RegExp([
133
- ...unsafeToChainActions,
133
+ ...unsafeToChainActions.map((action) => `^${action}$`),
134
134
  ...additionalMethods.map((method) => method instanceof RegExp ? method.source : method),
135
135
  ].join('|'))
136
136
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-cypress",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "An ESLint plugin for projects using Cypress",
5
5
  "main": "index.js",
6
6
  "author": "Cypress-io",
@@ -18,6 +18,10 @@ ruleTester.run('action-ends-chain', rule, {
18
18
  code: 'cy.focused().should("be.visible");',
19
19
  parserOptions,
20
20
  },
21
+ {
22
+ code: 'cy.submitBtn().click();',
23
+ parserOptions,
24
+ },
21
25
  ],
22
26
 
23
27
  invalid: [