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

Wrong config types in type declaration files #7654

Closed
jereaameli opened this issue Jun 10, 2020 · 3 comments · Fixed by #7674
Closed

Wrong config types in type declaration files #7654

jereaameli opened this issue Jun 10, 2020 · 3 comments · Fixed by #7674
Labels
cli type: typings Issue related to Cypress types (for TypeScript)

Comments

@jereaameli
Copy link

Current behavior:

When running Cypress through a script made in TypeScript, there are conflicts with the current Type Definitions with the actual configs supported.

There are some configs that accept both strings (path to a file / folder) or false to disable that options. The properties I have found that meet this criteria are fixturesFolder, supportFile and pluginsFile, but there could be more.

The type declarations for this config properties accept only strings as values, as seen here.

Screenshot of error thrown in VSCode:
image

Desired behavior:

false should be a valid value for this mentioned configs.

Example of correct type declaration:

pluginsFile: string | false

Test code to reproduce

// cypressScript.ts
import { run } from 'cypress';

const runConfig = {
  config: {
    pluginsFile: false,
  }
}

run(runConfig);
npx tsc cypressScript.ts

Versions

Cypress 4.8.0
OS: macOS Catalina 10.15.3

@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Jun 11, 2020
@jennifer-shehane jennifer-shehane added the type: typings Issue related to Cypress types (for TypeScript) label Jun 11, 2020
@jennifer-shehane
Copy link
Member

Opened a PR to fix this here: #7674

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 12, 2020

The code for this is done in cypress-io/cypress#7674, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Jun 12, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 23, 2020

Released in 4.9.0.

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

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

Successfully merging a pull request may close this issue.

2 participants