When I implement the following code snippet:
export const test = () => ({
yo: () => console.log('test'),
});
Cypress.Commands.add('test', test);
declare global {
namespace Cypress {
interface Chainable<Subject> {
test: typeof test;
}
}
}
There doesn't appear to be any visible errors in the code.
However, during testing, when I use cy.test().yo()
, I encounter an error stating 'yo' is not a function
- but this only happens when running the test.