Replicating plugins in component testing #25371
-
I am using Cypress to component test my Vue app. Following the code example at https://docs.cypress.io/guides/component-testing/vue/examples#Replicating-Plugins produces several errors, listed below: Argument of type '(this: Context, component: Property 'global' does not exist on type '[options?: MountingOptions<{ [x: number]: unknown; } Cannot find name 'Vapp'. No overload matches this call. import { createPinia } from "pinia"; declare global { Cypress.Commands.add("mount", (component, ...args) => { return mount(() => { |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Resolved with Vue Test Utils syntax: import { mount } from "cypress/vue"; Cypress.Commands.add("mount", (component) => { |
Beta Was this translation helpful? Give feedback.
Resolved with Vue Test Utils syntax:
import { mount } from "cypress/vue";
Cypress.Commands.add("mount", (component) => {
return mount(component, {
global: {
plugins: [createPinia(), i18n],
},
});
});