Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 1.72 KB

import-mount-functions.md

File metadata and controls

71 lines (53 loc) · 1.72 KB

Different frameworks render their components differently, so we provide framework-specific mount() functions, which can be imported like so:

A note for React users

The mount() command exported from the cypress/react module supports standard JSX syntax for mounting components.

// React 18
import { mount } from 'cypress/react18'

// React 16, 17
import { mount } from 'cypress/react'

A note for Vue users

The mount() command exported from the cypress/vue library uses Vue Test Utils internally, but instead of mounting your components in a virtual browser in node, it mounts them in your actual browser.

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

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

A note for Angular users

The mount() command exported from the cypress/angular library uses Angular TestBed internally, but instead of mounting your components in a virtual browser in node, it mounts them in your actual browser.

import { mount } from 'cypress/angular'