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

Custom command types #43

Open
rndmerle opened this issue Sep 30, 2021 · 3 comments
Open

Custom command types #43

rndmerle opened this issue Sep 30, 2021 · 3 comments

Comments

@rndmerle
Copy link

Hi and thanks for this package, this is coming in handy.
Any way to declare types for custom commands and chai-subsets ?
Extending Cypress.Chainable and Cypress.Chainer interfaces the classic way in a .d.ts doesn't seem to work.

@rndmerle
Copy link
Author

Well, actually with a .ts test file instead of .js is working alright.

@brianbento
Copy link

@rndmerle Could you explain what you did? I'm having some issues.

@rndmerle
Copy link
Author

rndmerle commented Nov 2, 2021

Well nothing fancy.

test/dts/cypress-commands.d.ts :

declare namespace Cypress {
  interface Chainable {
    $whatever(): Chainable<any>
  }
}

tsconfig.json :

"typeRoots": ["node_modules/@types", "test/__dts__"],
"include": [
  // ... other source directories
  "test/**/*.ts",
]

If it doesn't help, maybe could you provide a minimal repo reproducing the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants