-
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
feat: validate specPattern root level #19980
feat: validate specPattern root level #19980
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ FlakinessThis 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 |
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.
Nice job, looks good - just some general comments, I wonder if we want to do a full DX review prior to merging this, or do that later? Eg baseUrl
might need validating, also it seems like __snapshots__
should be a default ignoreSpecPattern
for CT.
'env': { | ||
'cypress-plugin-snapshots': { | ||
'prettier': true, | ||
}, | ||
}, | ||
'component': { | ||
'ignoreSpecPattern': [ |
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.
I wonder if this should be the default for CT. @cowboy maybe?
I also think baseUrl
should be disallowed top level, it's E2E only. We should defs go over the config changes w/ a fine toothed comb to make sure everything is 💯, but this PR is definitely a good start.
|
||
let ctx: DataContext | ||
|
||
beforeEach(async () => { |
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.
Cool, I wonder if we want a createTestDataContext
method that does all this - I think a lot of tests might benefit from it.
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.
Yeah! we may want to move to a util, that can be really useful so we can create more unit tests for different dataSources and dataActions
await ctx.fs.remove(temporary) | ||
}) | ||
|
||
it('find all the *.cy.{ts,js} excluding the e2e', async () => { |
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.
Nice, we definitely needed these tests.
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.
component.ignoreSpecPattern
should use the ignore
option from fast-glob
and write a VERY important unit test that verifies that **/node_modules/**
is set as the value to prevent accidentally reading in all files in node_modules
as it describes in this section:
https://github.com/mrmlnc/fast-glob#how-to-exclude-directory-from-reading
b53e599
* 10.0-release: feat: validate specPattern root level (#19980) feat(unify): unsupported browsers (#19997) feat: persist isSideNavigationOpen (#20026) feat: add types for urqlCacheKeys (#20027) fix: rename spec.js to spec.cy.js (#20029) feat: waiting for dependencies to be installed in wizard (#19955) fix: migrate config fields to correct the location (#19940) feat: relaunch browser when switching testing types from app (#19961) test: final ct-audit tests and component tweaks (#19948)
User facing changelog
Additional details
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?