Skip to main content

Vue API

Methods​

mount​

// Vue 3
import { mount } from 'cypress/vue'

// Vue 2
import { mount } from 'cypress/vue2'
Description

Used for mounting Vue components in isolation. It is responsible for rendering the component within Cypress's sandboxed iframe and handling any framework-specific cleanup.

Signature

mount(originalComponent: { new (...args: any[]): ; __vccOpts: any; }, options?: MountOptions): Cypress.Chainable<MountReturn>

mount Parameters
NameTypeDescription
originalComponentnew (...args: any[])The component to mount in test
optionsMountOptions (optional)The options for mounting the component

Interfaces​

MountOptions​

(Vue 3 MountingOptions or Vue 2 MountingOptions) from Vue Test Utils

MountReturn​

Type that the mount function yields

members
NameTypeDescription
wrapperVueWrapperThe Vue Test Utils wrapper
componentVueComponentThe component instance