···11+{
22+ "name": "Using fixtures to represent data",
33+ "email": "hello@cypress.io",
44+ "body": "Fixtures are a great way to mock data for responses to routes"
55+}
+6
tests/e2e/specs/test.cy.ts
···11+describe('My First Test', () => {
22+ it('Visits the app root url', () => {
33+ cy.visit('/')
44+ cy.contains('#container', 'Ready to create an app?')
55+ })
66+})
+37
tests/e2e/support/commands.ts
···11+/// <reference types="cypress" />
22+// ***********************************************
33+// This example commands.ts shows you how to
44+// create various custom commands and overwrite
55+// existing commands.
66+//
77+// For more comprehensive examples of custom
88+// commands please read more here:
99+// https://on.cypress.io/custom-commands
1010+// ***********************************************
1111+//
1212+//
1313+// -- This is a parent command --
1414+// Cypress.Commands.add('login', (email, password) => { ... })
1515+//
1616+//
1717+// -- This is a child command --
1818+// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
1919+//
2020+//
2121+// -- This is a dual command --
2222+// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
2323+//
2424+//
2525+// -- This will overwrite an existing command --
2626+// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
2727+//
2828+// declare global {
2929+// namespace Cypress {
3030+// interface Chainable {
3131+// login(email: string, password: string): Chainable<void>
3232+// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
3333+// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
3434+// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
3535+// }
3636+// }
3737+// }
+20
tests/e2e/support/e2e.ts
···11+// ***********************************************************
22+// This example support/e2e.ts is processed and
33+// loaded automatically before your test files.
44+//
55+// This is a great place to put global configuration and
66+// behavior that modifies Cypress.
77+//
88+// You can change the location of this file or turn off
99+// automatically serving support files with the
1010+// 'supportFile' configuration option.
1111+//
1212+// You can read more here:
1313+// https://on.cypress.io/configuration
1414+// ***********************************************************
1515+1616+// Import commands.js using ES2015 syntax:
1717+import './commands'
1818+1919+// Alternatively you can use CommonJS syntax:
2020+// require('./commands')
+10
tests/unit/example.spec.ts
···11+import { mount } from '@vue/test-utils'
22+import HomePage from '@/views/HomePage.vue'
33+import { describe, expect, test } from 'vitest'
44+55+describe('HomePage.vue', () => {
66+ test('renders home vue', () => {
77+ const wrapper = mount(HomePage)
88+ expect(wrapper.text()).toMatch('Ready to create an app?')
99+ })
1010+})