When using Cypress 8.x.x, the following Cypress command works fine:
declare global {
namespace Cypress {
interface Chainable<Subject> {
login(): Chainable<Token>;
}
}
}
Cypress.Commands.add('login', () => {
return new Cypress.Promise((resolve, reject) => {
// rest
});
});
However, upon updating to Cypress 9.x.x, I encounter this TypeScript error:
argument of type '() => Bluebird<unknown>' is not assignable to parameter of type '(person?: Partial<Person>) => Chainable<Token>'.
Type 'Bluebird<unknown>' is missing the following properties from type 'Chainable<Token>': and, as, blur, check, and 83 more.ts(2345)