How can i type a command with custom Chainable class
kingfolk opened this issue · comments
Jialei Jin commented
Desire the following to work, but seems commands.ts
is not a regular ts
module file.
login: (options?: Object) => Chainable<LoginContext>;
Pierre Criulanscy commented
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', () => {});