eslint-plugin-cypress 4.3.0 → 5.0.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.
- package/.node-version +1 -1
- package/.nvmrc +1 -1
- package/CONTRIBUTING.md +2 -7
- package/ESLINTRC-CONFIG.md +3 -143
- package/FLAT-CONFIG.md +1 -3
- package/README.md +25 -19
- package/circle.yml +2 -20
- package/eslint.config.mjs +13 -6
- package/lib/flat.js +14 -14
- package/lib/rules/assertion-before-screenshot.js +21 -21
- package/lib/rules/no-assigning-return-values.js +4 -4
- package/lib/rules/no-async-before.js +10 -10
- package/lib/rules/no-async-tests.js +10 -10
- package/lib/rules/no-chained-get.js +32 -32
- package/lib/rules/no-debug.js +18 -19
- package/lib/rules/no-force.js +21 -24
- package/lib/rules/no-pause.js +18 -19
- package/lib/rules/no-unnecessary-waiting.js +13 -13
- package/lib/rules/no-xpath.js +10 -10
- package/lib/rules/require-data-selectors.js +14 -14
- package/lib/rules/unsafe-to-chain-command.js +13 -13
- package/package.json +12 -14
- package/test-project/eslint-configs/eslint.default-deprecated.mjs +11 -0
- package/test-project/eslint-configs/eslint.default.mjs +1 -1
- package/test-project/eslint-configs/eslint.globals.mjs +1 -1
- package/test-project/eslint-configs/eslint.recommended.mjs +1 -1
- package/tests/lib/rules/no-chained-get.js +15 -15
- package/tests/lib/rules/no-debug.js +6 -6
- package/tests/lib/rules/no-force.js +22 -22
- package/tests/lib/rules/no-pause.js +6 -6
- package/tests/lib/rules/no-xpath.js +15 -15
- package/tests/lib/rules/unsafe-to-chain-command.js +1 -1
- package/vitest.config.mts +8 -0
- package/jest.config-legacy.js +0 -6
- package/jest.config.js +0 -6
- package/legacy.js +0 -36
- package/tests-legacy/config.js +0 -26
- package/tests-legacy/lib/rules/assertion-before-screenshot.js +0 -35
- package/tests-legacy/lib/rules/no-assigning-return-values.js +0 -38
- package/tests-legacy/lib/rules/no-async-before.js +0 -25
- package/tests-legacy/lib/rules/no-async-tests.js +0 -25
- package/tests-legacy/lib/rules/no-force.js +0 -49
- package/tests-legacy/lib/rules/no-pause.js +0 -37
- package/tests-legacy/lib/rules/no-unnecessary-waiting.js +0 -71
- package/tests-legacy/lib/rules/require-data-selectors.js +0 -31
- package/tests-legacy/lib/rules/unsafe-to-chain-command.js +0 -56
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const rule = require('../../../lib/rules/unsafe-to-chain-command')
|
|
4
|
-
const RuleTester = require('eslint').RuleTester
|
|
5
|
-
|
|
6
|
-
const ruleTester = new RuleTester()
|
|
7
|
-
|
|
8
|
-
const errors = [{ messageId: 'unexpected' }]
|
|
9
|
-
const parserOptions = { ecmaVersion: 6 }
|
|
10
|
-
|
|
11
|
-
ruleTester.run('action-ends-chain', rule, {
|
|
12
|
-
valid: [
|
|
13
|
-
{
|
|
14
|
-
code: 'cy.get("new-todo").type("todo A{enter}"); cy.get("new-todo").type("todo B{enter}"); cy.get("new-todo").should("have.class", "active");',
|
|
15
|
-
parserOptions,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
code: 'cy.focused().should("be.visible");',
|
|
19
|
-
parserOptions,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
code: 'cy.submitBtn().click();',
|
|
23
|
-
parserOptions,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
|
|
27
|
-
invalid: [
|
|
28
|
-
{
|
|
29
|
-
code: 'cy.get("new-todo").type("todo A{enter}").should("have.class", "active");',
|
|
30
|
-
parserOptions,
|
|
31
|
-
errors,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
code: 'cy.get("new-todo").type("todo A{enter}").type("todo B{enter}");',
|
|
35
|
-
parserOptions,
|
|
36
|
-
errors,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
code: 'cy.get("new-todo").focus().should("have.class", "active");',
|
|
40
|
-
parserOptions,
|
|
41
|
-
errors,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
code: 'cy.get("new-todo").customType("todo A{enter}").customClick();',
|
|
45
|
-
options: [{ methods: ['customType', 'customClick'] }],
|
|
46
|
-
parserOptions,
|
|
47
|
-
errors,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
code: 'cy.get("new-todo").customPress("Enter").customScroll();',
|
|
51
|
-
options: [{ methods: [/customPress/, /customScroll/] }],
|
|
52
|
-
parserOptions,
|
|
53
|
-
errors,
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
})
|