#3475874: Enforce ESLint and Prettier on Cypress tests
requested to merge issue/experience_builder-3475874:3475874-enforse-eslint-and-prettier-on-cypress into 0.x
Closes #3475874
- Added
eslint-plugin-cypress
andeslint-plugin-chai-friendly
to the eslint config underoverrides
so it is only
applied to the UI test directory. The chai plugin is used to allow the use of 'expect' in the UI tests without
triggering an eslint error. I added a comment in the config that explains this. - Renamed the npm command from
format
toprettier:fix
and I also added aprettier:check
command. - Added mention of
eslint-plugin-cypress
to the testing section of the README.
Test files that contains manual changes unrelated to prettier fixes:
-
prop-types.cy.js
(changed to adhere to unsafe-to-chain-command) -
undo-redo.cy.js
(unsafe-to-chain-command) -
xb-canvas.cy.js
(unsafe-to-chain-command) -
commands.js
(no-restricted-globals) -
e2e.js
(no-extend-native does not like extending the native String object so I replaced it with a utils functiononlyVisibleChars
in newly created utils.js) -
add-section.cy.js
(updated to use newonlyVisibleChars
function) -
xb-general.cy.js
(updated to use newonlyVisibleChars
function, unsafe-to-chain-command fixes and updated a selector that looked like a copy and paste error from a previous MR- left a comment) -
configuration-slice.cy.js
(changed to use file path alias for import statements) -
layout-slice.cy.js
(changed to use file path alias for import statements) -
layout-utils.cy.js
(changed to use file path alias for import statements) -
ui-slice.cy.js
(changed to use file path alias for import statements)
Edited by Harumi Jang