From acef36579502e9b20d06cf2feb0c346d25797cae Mon Sep 17 00:00:00 2001 From: Alireza Date: Wed, 23 Oct 2024 19:26:13 +0200 Subject: [PATCH] chore: fix eslint being disabled for e2e tests a `.only()` was missed due to e2e files not going through linting. --- .eslintignore | 2 -- .eslintrc.js | 11 +++++++++-- .../jui/cypress/cypress-plugin-snapshots-types.d.ts | 4 +++- packages/jui/cypress/e2e/vcs/rollback.cy.ts | 2 +- packages/jui/cypress/support/example-app/commands.ts | 1 + packages/jui/cypress/support/shared.ts | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.eslintignore b/.eslintignore index 4d7ee2d3..98c6e456 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,5 +4,3 @@ dist _templates - -cypress diff --git a/.eslintrc.js b/.eslintrc.js index c2b27c9a..5b5fb769 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -52,7 +52,12 @@ module.exports = { }, }, { - files: ["packages/jui/scripts/**", "babel.config.js", ".eslintrc.js"], + files: [ + "packages/jui/scripts/**", + "babel.config.js", + ".eslintrc.js", + "**/webpack.config.ts", + ], env: { node: true, }, @@ -63,6 +68,7 @@ module.exports = { excludedFiles: [ "packages/**/*.+(stories|test|spec|cy).tsx", "packages/jui/src/**/story-helpers.tsx", + "**/cypress/**", ], rules: { "no-restricted-imports": [ @@ -86,10 +92,11 @@ module.exports = { }, { // Only cypress test files - files: ["packages/**/*.cy.+(ts|tsx)"], + files: ["packages/**/*.cy.+(ts|tsx)", "**/cypress/**"], plugins: ["cypress", "no-only-tests"], env: { "cypress/globals": true, + node: true, }, rules: { "no-only-tests/no-only-tests": ERROR, diff --git a/packages/jui/cypress/cypress-plugin-snapshots-types.d.ts b/packages/jui/cypress/cypress-plugin-snapshots-types.d.ts index c98792ad..3b349c90 100644 --- a/packages/jui/cypress/cypress-plugin-snapshots-types.d.ts +++ b/packages/jui/cypress/cypress-plugin-snapshots-types.d.ts @@ -3,6 +3,8 @@ // TODO: remove this file when a new version of cypress-plugin-snapshots is release. remember to add // "cypress-plugin-snapshots" to "types" array in tsconfig.cypress.json // See more: https://github.com/meinaart/cypress-plugin-snapshots/issues/193 +/* global JQuery */ + declare namespace Cypress { interface Chainable { toMatchSnapshot( @@ -23,7 +25,7 @@ declare namespace Cypress { thresholdType: "percent" | "pixels"; resizeDevicePixelRatio: boolean; }>; - screenshotConfig: Partial; + screenshotConfig: Partial; name: string; separator: string; }> diff --git a/packages/jui/cypress/e2e/vcs/rollback.cy.ts b/packages/jui/cypress/e2e/vcs/rollback.cy.ts index 34367a8f..abdf1e5a 100644 --- a/packages/jui/cypress/e2e/vcs/rollback.cy.ts +++ b/packages/jui/cypress/e2e/vcs/rollback.cy.ts @@ -14,7 +14,7 @@ describe("vcs => rollback", () => { deleteFile("removed-file.ts") ); - it.only("can rollback a combination of additions and modifications, not deleting local copies", () => { + it("can rollback a combination of additions and modifications, not deleting local copies", () => { cy.initialization(withDifferentChangeTypes); cy.step("Verify initial state"); diff --git a/packages/jui/cypress/support/example-app/commands.ts b/packages/jui/cypress/support/example-app/commands.ts index f601d4ab..9342b32e 100644 --- a/packages/jui/cypress/support/example-app/commands.ts +++ b/packages/jui/cypress/support/example-app/commands.ts @@ -1,5 +1,6 @@ /// /// +/* global JQuery */ import { AppGlobals } from "./AppGlobals"; diff --git a/packages/jui/cypress/support/shared.ts b/packages/jui/cypress/support/shared.ts index 48916be5..d654c747 100644 --- a/packages/jui/cypress/support/shared.ts +++ b/packages/jui/cypress/support/shared.ts @@ -23,6 +23,7 @@ // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) +/* global JQuery */ import "cypress-real-events/support"; import "cypress-plugin-snapshots/commands";