Move cypress to client folder#3566
Conversation
|
@arikfr we spoke about this a few weeks ago. I think we should consider moving |
517a1fe to
41abf2d
Compare
|
It seems I missed some config for CodeClimate (it only caught my test for cypress). It also made eslint required for build. I'll need to check this more calmly. |
|
How about instead |
This crossed my mind :-) But I thought that moving eslint configuration will be easier. |
It should be. |
Would also make lint-staged config easier with "ignore": "lint-staged": {
"linter": {
"client/**/*.{js,jsx}": [
"npm run lint:base",
"npm run test -- --bail --findRelatedTests"
]
},
"ignore": ["client/dist/*"]
}rather than having to set two linter paths and repeating the config: "lint-staged": {
"client/app/**/*.{js,jsx}": [
"npm run lint:base",
"npm run test -- --bail --findRelatedTests"
],
"cypress/**/*.{js,jsx}": [
"npm run lint:base",
"npm run test -- --bail --findRelatedTests"
]
} |
|
@ranbena 👍 |
Not sure this would be a good approach, but it did work 😅 "lint-staged": {
"{client/app,cypress}/**/*.{js,jsx}": [
"npm run lint:base",
"npm run test -- --bail --findRelatedTests"
]
}But I'll go with cypress in client folder option 😆 |
|
@arikfr this lgtm. You cool with this? |
arikfr
left a comment
There was a problem hiding this comment.
Looks good. See comment on paths.
| "pluginsFile": "client/cypress/plugins/index.js", | ||
| "screenshotsFolder": "client/cypress/screenshots", | ||
| "videosFolder": "client/cypress/videos", | ||
| "supportFile": "client/cypress/support/index.js" |
There was a problem hiding this comment.
Cypress assumes that it's in the root folder? Maybe there is a way to set its path/context once to avoid having to maintain all these folders/files mapping?
There was a problem hiding this comment.
Perhaps fileServerFolder: "client/"?
There was a problem hiding this comment.
Cypress assumes that it's in the root folder? Maybe there is a way to set its path/context once to avoid having to maintain all these folders/files mapping?
Yes 😕, I didn't like that I had to change all of those either.
The way I see that could probably set the path/context is changing npm run cypress open and npm run cypress run to run from another path. However, the current option seems better than that. With cypress knowing it's not in the root folder, you can run still run it using other commands: cypress open (in case you have it global) or npx cypress open.
LMK if you had something simpler in mind
Perhaps fileServerFolder: "client/"?
I thought about this one too. I actually didn't get what's its purpose, but changing it doesn't affect what we want. Cypress keeps thinking it's in the root folder and, since there's no cypress folder in there, it creates it in an empty state.
|
@arikfr I'd really like this to land asap. |
|
I didn't realize this was waiting for me. I just asked if there is another option :) |
Once merged, I'll rebase #3635 and fix the lint errors. |
What type of PR is this? (check all applicable)
Description
Moved Cypress to client folder, so eslint works for it by default.
Related Tickets & Documents
Nope
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
Nope