From 0a70707e93c0f5b0c4f8bc036798740305f55e76 Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Sun, 12 May 2024 09:32:10 +0200 Subject: [PATCH 1/2] test: add ordering rules --- eslint.config.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index a1ccc87..446a6ec 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -18,6 +18,8 @@ export default [ 'eslint-plugin/require-meta-docs-url': ['error', { 'pattern': 'https://github.com/cypress-io/eslint-plugin-cypress/blob/master/docs/rules/{{name}}.md' }], 'eslint-plugin/require-meta-docs-description': 'error', + 'eslint-plugin/meta-property-ordering': 'error', + 'eslint-plugin/test-case-property-ordering': 'error', 'n/no-extraneous-require': ['error', { 'allowModules': ['jest-config'] }], 'mocha/no-mocha-arrows': 'off', From f53f7dfa7bc9dc78a6e4a834cc4373b418799f4c Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Sun, 12 May 2024 09:42:11 +0200 Subject: [PATCH 2/2] test: fix test property ordering --- tests-legacy/lib/rules/unsafe-to-chain-command.js | 4 ++-- tests/lib/rules/unsafe-to-chain-command.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests-legacy/lib/rules/unsafe-to-chain-command.js b/tests-legacy/lib/rules/unsafe-to-chain-command.js index 470bebd..901d878 100644 --- a/tests-legacy/lib/rules/unsafe-to-chain-command.js +++ b/tests-legacy/lib/rules/unsafe-to-chain-command.js @@ -42,15 +42,15 @@ ruleTester.run('action-ends-chain', rule, { }, { code: 'cy.get("new-todo").customType("todo A{enter}").customClick();', + options: [{ methods: ['customType', 'customClick'] }], parserOptions, errors, - options: [{ methods: ['customType', 'customClick'] }], }, { code: 'cy.get("new-todo").customPress("Enter").customScroll();', + options: [{ methods: [/customPress/, /customScroll/] }], parserOptions, errors, - options: [{ methods: [/customPress/, /customScroll/] }], }, ], }) diff --git a/tests/lib/rules/unsafe-to-chain-command.js b/tests/lib/rules/unsafe-to-chain-command.js index 945badb..fc97aa9 100644 --- a/tests/lib/rules/unsafe-to-chain-command.js +++ b/tests/lib/rules/unsafe-to-chain-command.js @@ -22,13 +22,13 @@ ruleTester.run('action-ends-chain', rule, { { code: 'cy.get("new-todo").focus().should("have.class", "active");', errors }, { code: 'cy.get("new-todo").customType("todo A{enter}").customClick();', - errors, options: [{ methods: ['customType', 'customClick'] }], + errors, }, { code: 'cy.get("new-todo").customPress("Enter").customScroll();', - errors, options: [{ methods: ['customPress', 'customScroll'] }], + errors, }, ], })