Skip to content

Commit 4e4613d

Browse files
committed
fix: updated eslint rules for cypress files
1 parent 24bbf07 commit 4e4613d

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

.eslintrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
"globals": {
2626
"strapi": true
2727
},
28+
"overrides": [
29+
{
30+
"files": [
31+
"**/*.cy.*",
32+
"./cypress/**/*.*"
33+
],
34+
"extends": [
35+
"plugin:cypress/recommended"
36+
],
37+
"parserOptions": {
38+
"project": "./tsconfig.cypress.json"
39+
}
40+
}
41+
],
2842
"rules": {
2943
"import/no-unresolved": [2, {
3044
"ignore": [

admin/src/index.cy.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/// <reference types="cypress" />
2-
//
1+
// <reference types="cypress" />
32

43
describe('Config Sync', () => {
54
beforeEach(() => {

cypress.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = defineConfig({
1010
requestTimeout: 10000,
1111
setupNodeEvents(on, config) {
1212
// implement node event listeners here.
13+
// eslint-disable-next-line global-require
1314
require('cypress-terminal-report/src/installLogsPrinter')(on);
1415

1516
on('task', {
@@ -21,7 +22,7 @@ module.exports = defineConfig({
2122
console.log(`folder ${folderName} deleted`);
2223
return null;
2324
})
24-
.catch(err => {
25+
.catch((err) => {
2526
console.error(`error deleting folder ${folderName}`, err);
2627
throw err;
2728
});

cypress/support/commands.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference types="cypress" />
1+
// <reference types="cypress" />
22
// ***********************************************
33
// This example commands.ts shows you how to
44
// create various custom commands and overwrite
@@ -43,6 +43,7 @@ Cypress.Commands.add('login', (path) => {
4343
cy.wait('@adminInit').its('response.statusCode').should('equal', 200);
4444

4545
// Wait for the form to render.
46+
// eslint-disable-next-line cypress/no-unnecessary-waiting
4647
cy.wait(1000);
4748

4849
cy.get('body').then(($body) => {
@@ -120,7 +121,8 @@ Cypress.Commands.add('makeConfigChanges', (path) => {
120121
}).as('saveUpEmailTemplates');
121122
cy.get('a[href="/admin/settings/users-permissions/email-templates"]').click();
122123
cy.get('tbody tr').contains('Reset password').click();
123-
cy.get('input[name="options.response_email"]').clear().type(`${Math.random().toString(36).substring(2, 15)}@example.com`);
124+
cy.get('input[name="options.response_email"]').clear();
125+
cy.get('input[name="options.response_email"]').type(`${Math.random().toString(36).substring(2, 15)}@example.com`);
124126
cy.get('button[type="submit"]').click();
125127
cy.wait('@saveUpEmailTemplates').its('response.statusCode').should('equal', 200);
126128
});

0 commit comments

Comments
 (0)