Skip to content
프로젝트

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

GitHub에서 보기

소개

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

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
기록 수집 중
in 7 days
기록 수집 중
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

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.

관련 프로젝트 살펴보기

불러오는 중…