-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: do not show incorrectly support file migration step #22015
Changes from 4 commits
e6eaed9
86f533e
d6d9904
a38254e
775c74d
527c167
1bca169
2e5b5d6
a09ef43
86f95c3
60f3006
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import _ from 'lodash' | ||
|
||
export const isDefaultSupportFile = (supportFile: string) => { | ||
if (_.isNil(supportFile) || !_.isBoolean(supportFile) && supportFile.match(/^cypress\/support($|\/index($|\.(ts|js|coffee)$))/)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this code was lifted, but what happens if the user has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should update the regex for something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated in 2e5b5d6 |
||
return true | ||
} | ||
|
||
return false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
## Migration E2E Custom SupportFile | ||
|
||
An e2e project with a custom `supportFile` named `src/platform/testing/e2e/cypress/support/index.js`. It includes | ||
the default value on the path but is not the default. | ||
|
||
The following migration steps will be used during this migration: | ||
|
||
- [x] automatic file rename | ||
- [ ] manual file rename | ||
- [] rename support | ||
- [x] update config file | ||
- [ ] setup component testing | ||
|
||
|
||
## Automatic Migration | ||
|
||
Unless the user skips this step, after this step, the filesystem will be: | ||
|
||
| Before | After| | ||
|---|---| | ||
| `src/basic.test.js` | `src/basic.cy.js` | | ||
|
||
## Manual Files | ||
|
||
This step is not used. | ||
|
||
## Update Config | ||
|
||
We can migrate to the new `cypress.config.js`. The expected output is in `expected-cypress.config.js`. The main points are: | ||
|
||
|
||
The expected output is in [`expected-cypress.config.js`](./expected-cypress.config.js). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"supportFile": "src/platform/testing/e2e/cypress/support/index.js" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { defineConfig } = require('cypress') | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
setupNodeEvents (on, config) { | ||
return require('./cypress/plugins/index.js')(on, config) | ||
}, | ||
supportFile: 'src/platform/testing/e2e/cypress/support/index.js', | ||
}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the
coffee
ext here