-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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: UNIFY-676 browsers should be configurable in setupNodeEvents #20367
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 |
@tgriesser There's a failure in the types:
|
We just need to interpolate the majorVersion now:
|
I had updated the type because it seemed to be wrong but who knows, the types in the server layer are pretty tough to follow. Didn't need to address it as part of this PR. |
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.
(whoops, meant to request changes. I really wish you could delete these things)
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.
2b005eb
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.
Would this mean that now config.browser
is available in the types of setupNodeEvents()
?
The value will always be null and setting it should have no effect.
How far off am I ?
Seems fine to me, I followed https://docs.cypress.io/guides/guides/launching-browsers#Customize-available-browsers and got this: I also fixed the typing errors in an effort to get this over the line: 97ba5cf |
Alrighty I got this green, let's get one more test/approval. The types are working fine for me, too, from what I can see. I had to specify |
Changing to draft to investigate why the |
This reverts commit 97ba5cf.
Nah, it's using a |
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.
Seems fine to me! I tried it as mentioned in a previous review and it worked okay, including types.
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.
@tgriesser I beg to disagree, the problem is still here:
The code below seems to be valid typed configFile.
import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
setupNodeEvents (on, config) {
config.browser = 'chrome'
},
},
})
What I am saying is that the types are not correct since they contain more than the actual object. Instead of helping the types we have here could confuse users.
I prefer that we do not fix it in this PR though.
@elevatebart I think what Tim means is since it's a I agree the idea would be the exact types (no nullable) but like you said we cannot do this right now, it's pretty complex and outside the scope of this PR. Edit: looks like we are on the same page, you've approved too - definitely good to improve the types more in the future. |
* 10.0-release: fix: comment link to accurate docs (#20437) fix: scaffold commands file (#20398) fix(launchpad): support default export (#20383) feat(launchpad): support for Vue CLI 5 (#20413) fix: UNIFY-676 browsers should be configurable in setupNodeEvents (#20367) fix: make launchpad link open default browser (#20399) fix(icons): publish the files in the package fix: build icons in build-prod (#20411) test: migrate module-api to 10.0 chore: build this branch test: migrate module_api to system tests (#20265) chore: remove pkg/driver //@ts-nocheck final (#20169) chore: fix "cannot find module" in clone-repo-and-checkout-release-branch (#20293) chore: Update Chrome (beta) to 99.0.4844.45 (#20234) chore: fix CI cache state for darwin (#20339) Add TODO comments feedback chore: move tests to its own file.
Adds a system test to show that filtering browsers is working properly &
$ExpectType
assertion fordtslint
to assert the correct type, @JessicaSachs' original issue