Skip to content

Property 'configureCypressTestingLibrary' does not exist on type 'cy & EventEmitter' #143

Closed
@mccataldo

Description

@mccataldo
  • cypress-testing-library version: 6.0.0
  • node version: 10.18.1
  • npm (or yarn) version: npm v6.13.4

Relevant code or config

FWIW I tried installing @types/testing-library__cypress v5.0.6 (even though it was already in node_modules).
Here's my tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "allowJs": true,
    "checkJs": false,
    "baseUrl": "../node_modules",
    "outDir": "./ConvertedJSFiles",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "types": [
      "cypress",
      "@types/testing-library__cypress"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  },
  "include": [
    "**/*.*"
  ],
  "exclude": [
    "node_modules",
    "cache"
  ]
}

What you did:

I enabled javascript checking via checkJs in tsconfig.json and invoked cy.configureCypressTestingLibrary in cypress/support/index.js

What happened:

Typescript is telling me Property 'configureCypressTestingLibrary' does not exist on type 'cy & EventEmitter'.

Many of my custom commands weren't recognized as being members of Cypress.Chainable and adding their definitions to commands.d.ts fixed it, and now configureCypressTestingLibrary is the only one giving me trouble. It looks like it's because it's missing from the type definitions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions