hecktarzuli / stress-free-testing

Stress-free Testing with Vue 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stress-free Testing with Vue 3, Cypress, and Vite

A pre-conference workshop for VueConf US 2022

πŸ”— Quick Links: Official Cypress Docs, Vue Test Utils API for Vue 3, Lachlan Miller's Vue Testing Handbook, Interacting with Elements using Cy Commands, Cypress API, Chai Matchers

Get Ready for the Day

Good morning! Either before or at the beginning of the workshop, make sure to set up your environment:

  1. If you don't already have it... install Node >= 14.17.0 with nvm and install yarn.

  2. Clone either the Stress Free Testing.

    gh repo clone JessicaSachs/stress-free-testing # Github CLI
  3. Or the Stress Free Testing TypeScript Repo

    gh repo clone JessicaSachs/stress-free-testing-ts
  4. Run yarn install.

  5. Download the recommended Desktop Apps (Miro + Figma).

  6. Install the recommended VSCode Extensions. You should see a small prompt pop up in the bottom-right corner of VSCode once you open the repository.

  7. Sign up for Miro and open the board.

  8. Open the Figma File and look through the mocks.

Branches

The accompanying repository for the "Stress-free Testing with Vue 3 and Vite" workshop is located at Stress Free Testing. All parts of this workshop will be completed in this repo. If you get lost or need to reset your workspace to a known good state, you may refer to the map of branches below.

Section Branch Description
πŸ”° The Beginning 1-the-beginning The "Hello World" Scaffold, great starting point for a template.
🐀 Simple Mount 2-simple-mount Working with Vue Test Utils' Syntax and JSX Syntax.
πŸ›  Setup Environment 3-setup-environment How to keep your tests production-like.
πŸ’… The Product Card 4-the-product-card Testing your first presentational component.
πŸ•΅ Powerful Mock Data 5-powerful-mock-data Use faker to generate realistic data and stress-test your UI.
πŸ”ˆ Emitted Events 6-emitted-events Assert custom and native events were invoked using cy.spy().
🎰 Slots 7-slots Testing slots easily with JSX.
🎰 🎰 Scoped Slots 8-scoped-slots Testing scoped slots not-as-easily with JSX.
πŸ”— Router 9-router Navigate throughout your application using Vue Router v4.
πŸ“¦ Stores and Plugins 10-stores-and-plugins Learn how to test a Pinia store.

App Downloads

  • πŸ“‹ Miro is where the majority of the workshop will be held (Desktop App Preferred, Workshop Board).
  • πŸ‘©β€πŸŽ¨ Figma contains the mocks for our App ([Desktop App][figma_downloads], Mockups).

Tooling

Ecosystem

  • Vue 3 with the new <script setup> syntax.
  • Vite for lightning-fast development.
  • Component Testing with Cypress Component Testing.
  • End-to-end Testing with Cypress E2E Testing.
  • Headless UI for quick and easy dropdowns, tabs, and more.

Styling

  • Windi CSS Logo WindiCSS, a Tailwind-compatible Utility CSS Framework for use within tests.
  • Iconify Icons to beautify the UI.

VSCode Extensions

Please use VSCode with Recommended Extensions for the best Developer Experience. Other editors should work fine, however support for all language features used in this workshop has not been tested.

  • Volar for Vue Syntax Highlighting.
  • Chris Breiding's Test Utils for toggling it.only and describe.only
  • Antfu's Iconify Visualizer to preview icons in your templates and script tags.
  • ESLint with Prettier for formatting.

About

Stress-free Testing with Vue 3


Languages

Language:JavaScript 50.2%Language:Vue 32.2%Language:HTML 10.4%Language:SCSS 7.2%