Skip to content
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

Typescript for runtime properties still missing? #19001

Closed
GCHQDeveloper911 opened this issue Nov 19, 2021 · 2 comments · Fixed by #18896
Closed

Typescript for runtime properties still missing? #19001

GCHQDeveloper911 opened this issue Nov 19, 2021 · 2 comments · Fixed by #18896
Labels
type: typings Issue related to Cypress types (for TypeScript)

Comments

@GCHQDeveloper911
Copy link
Contributor

Current behavior

When using typescript with Cypress, if I do something like:

if (Cypress.config('isInteractive')){
    cy.log('yes it is')
}

Then vsCode is complaining that "No overload matches this call" because "Type '"isInteractive"' has no properties in common with type 'ConfigOptions'"

Supposedly this was addressed in issue #14392 (pull req #14584) - but this seems to still be an issue.

Desired behavior

Cypress should provide support for runtime properties in the developer's IDE of choice.

Test code to reproduce

See above.

Cypress Version

9.0.0

Other

No response

@chrisbreiding chrisbreiding added the type: typings Issue related to Cypress types (for TypeScript) label Nov 24, 2021
@chrisbreiding
Copy link
Contributor

This definitely looks like an oversight in regards to our types. #14584 updated the type for Cypress.config() (no arguments), but when you pass in a key, it's accepting a returning a different type than Cypress.config().

I'm hoping it can be fixed as part of #18896.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 21, 2021

Released in 9.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.2.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: typings Issue related to Cypress types (for TypeScript)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants