Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

How can i type a command with custom Chainable class #5

Open
kingfolk opened this issue May 14, 2018 · 1 comment
Open

How can i type a command with custom Chainable class #5

kingfolk opened this issue May 14, 2018 · 1 comment

Comments

@kingfolk
Copy link

Desire the following to work, but seems commands.ts is not a regular ts module file.

login: (options?: Object) => Chainable<LoginContext>;
@PCreations
Copy link

PCreations commented May 27, 2019

Just add export {} at the top of the files to force it to be considered a valid module :

export {};
declare global {
  namespace Cypress {
    interface Chainable {
      login: () => void;
    }
  }
}
Cypress.Commands.add('login', () => {});

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

No branches or pull requests

2 participants