Skip to content
Proyectos

epicweb-dev/react-component-testing-with-vitest

Ver en GitHub

Acerca de

Test your React components in the actual browser with Vitest Browser Mode.

Desarrollo web y de aplicaciones

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
Recopilando historial
in 7 days
Recopilando historial
in 15 days
Recopilando historial
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

React Component Testing with Vitest

Learn how to test React components in the actual browser with Vitest.


Build Status GPL 3.0 License Code of Conduct

Prerequisites

You don't have to have any prior experience with Vitest or Vitest Browser Mode to complete this workshop.

  • A basic experience with TypeScript is required.
  • A basic experience with component-level testing is beneficial. This workshop works best if you've written component tests in the past. But don't worry if you haven't, you will write a bunch of those during the workshop!
  • Get familiar with React Testing Library, especially its Guiding Principles. You don't need to have any prior experience of using the library.

Pre-workshop Resources

Here are some resources you can read before taking the workshop to get you up to speed on some of the tools and concepts we'll be covering:

System Requirements

  • git v2.18 or greater
  • NodeJS v22 or greater
  • npm v8 or greater

All of these must be available in your PATH. To verify things are set up properly, you can run this:

git --version
node --version
npm --version

If you have trouble with any of these, learn more about the PATH environment variable and how to fix it here for windows or mac/linux.

Setup

Use the Epic Workshop CLI to get this setup:

npx --yes epicshop@latest add react-component-testing-with-vitest

If you experience errors here, please open an issue with as many details as you can offer.

The Workshop App

Learn all about the workshop app on the Epic Web Getting Started Guide.

Kent with the workshop app in the background

Troubleshooting

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'epicshop'

Reason: You likely have ignore-scripts=true in your .npmrc, which skips the postinstall script that installs the workshop app.

Solution: Remove ignore-scripts=true from your ~/.npmrc and run the setup command again.

Could not locate workshop-app directory

Reason: You ran npx epicshop start, which uses the globally installed epicshop CLI that cannot find the workshop app.

Solution: Either one of the following:

  • Run npm start in the workshop directory instead;
  • Install the workshop app globally with npm install -g @epic-web/workshop-app and run the epicshop start command again.

Explorar proyectos relacionados

Cargando…