rafaelfesi / cypress-loves-vite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cypress ๐Ÿ’– Vite

Hello! This repo is for my talk at VueConfUS on April 14th. Tickets are free, so if you like this repo, you'll probably want to watch my talk.

It is very likely that some of the tests in this repo will break. Its goal is to give you a bundler setup and dependencies that work.

The latest guides are here:

https://on.cypress.io/component-testing

Getting Started

Install dependencies

yarn

Open component testing

yarn cy

Make some new files

MyNewComponent.vue

<template>
  <h1>Hello world! ๐Ÿ‘‹</h1>
</template>

MyNewComponent.cy.js

import { mount } from '@cypress/vue'
import MyNewComponent from './MyNewComponent.vue' // keep the .vue, Vite needs it

describe('MyNewComponent', () => {
  it('renders', () => {
    mount(MyNewComponent)
      .get('h1')
      .should('have.text', 'Hello world')
  })
})

About


Languages

Language:JavaScript 54.4%Language:Vue 43.1%Language:CSS 1.3%Language:HTML 1.2%