Closed Gennady77 closed 1 month ago
Yes, Cypress ships Vue test utils out of the box, however, it is not types as property of "cy" global constant. You have to make a module augmentation. You can read more about augmentation here: https://docs.cypress.io/guides/tooling/typescript-support
However for your issue you can use following code placed somewhere in "src" or "tests" folder as they are resolved by tsconfig, hence included into the compilation
https://docs.cypress.io/guides/tooling/typescript-support
src/cypress-augmentation.d.ts
import { mount } from "cypress/vue"
declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount;
}
}
}
@Gennady77 Does this help resolve your issue?
@Gennady77 Does this help resolve your issue?
I had the same problem and your answer helped me to resolve the problem. Thx
Current behavior
I wrote test accordingly instruction and got TS error - Property 'mount' does not exist on type 'cy & CyEventEmitter'. my tsconfig file
Desired behavior
there should be no error
Test code to reproduce
Cypress Version
10.3.1
Node version
16.18.0
Operating System
macOS 14.1.1
Debug Logs
No response
Other
No response