Skip to content

Commit

Permalink
chore: fix eslint being disabled for e2e tests
Browse files Browse the repository at this point in the history
a `.only()` was missed due to e2e files not going through linting.
  • Loading branch information
alirezamirian committed Oct 23, 2024
1 parent 8b488dc commit acef365
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ dist

_templates


cypress
11 changes: 9 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -63,6 +68,7 @@ module.exports = {
excludedFiles: [
"packages/**/*.+(stories|test|spec|cy).tsx",
"packages/jui/src/**/story-helpers.tsx",
"**/cypress/**",
],
rules: {
"no-restricted-imports": [
Expand All @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion packages/jui/cypress/cypress-plugin-snapshots-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Subject = any> {
toMatchSnapshot(
Expand All @@ -23,7 +25,7 @@ declare namespace Cypress {
thresholdType: "percent" | "pixels";
resizeDevicePixelRatio: boolean;
}>;
screenshotConfig: Partial<ScreenshotDefaultsOptions>;
screenshotConfig: Partial<Cypress.ScreenshotDefaultsOptions>;
name: string;
separator: string;
}>
Expand Down
2 changes: 1 addition & 1 deletion packages/jui/cypress/e2e/vcs/rollback.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions packages/jui/cypress/support/example-app/commands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="cypress-real-events" />
/// <reference types="@testing-library/cypress" />
/* global JQuery */

import { AppGlobals } from "./AppGlobals";

Expand Down
1 change: 1 addition & 0 deletions packages/jui/cypress/support/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit acef365

Please sign in to comment.