-
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: typescript default plugin file #20046
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
return cfg.pluginsFile ? cfg.pluginsFile : DEFAULT_PLUGIN_PATH | ||
return cfg.pluginsFile ? cfg.pluginsFile : pluginPath | ||
} catch { | ||
return cfg.pluginsFile ? cfg.pluginsFile : path.normalize('cypress/plugins/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.
If cfg.pluginsFile is defined, can we return early?
if (cfg.pluginsFile) {
return cfg.pluginsFile
}
try {
let pluginPath = path.normalize('cypress/plugins/index.ts')
await fs.stat(path.join(root, pluginPath))
return pluginPath
} catch {
return path.normalize('cypress/plugins/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.
Good call
* 10.0-release: chore: make error more informative about migration to Cypress 10 (#20007) fix: remove shelljs in example build script, correct file renames fix: last step in the ct setup goes back to start (#20030) fix: typescript default plugin file (#20046) chore: fix cypress npm package artifact upload path (#20023) chore(driver): move cy.within logic into it's own file (#20036) chore: update automerge workflows (#19982) fix(selectFile): use target window's File/DataTransfer classes (#20003) chore: Update Chrome (stable) to 98.0.4758.80 and Chrome (beta) to 98.0.4758.80 (#19995) fix: Adjust ffmpeg CLI args for performance (#19983) build: allow unified to run cypress on Apple Silicon (arm64) (backport #19067 to 9.x) (#19968) release 9.4.1 [skip ci] fix: trigger 9.4.1 build release 9.4.0 [skip ci]
In typescript projects the default pluginFile can be an
index.ts
file. Currently we always assumed it was a js file and would not complete migration correctly.PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?