Skip to content

Wrong config types in type declaration files #7654

@jereaameli

Description

@jereaameli

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    clitype: typingsIssue related to Cypress types (for TypeScript)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions