Загрузка...

How to add Unit Tests to Vite Project? React Unit Testing Tutorial with Testing Library and Vitest

Learn how to set up unit tests in a ReactJS project created with ViteJS. Step-by-step process of integrating React Testing Library and Vitest into Lyrics Search project

Source code: https://github.com/DzmitryUr/react-apps/tree/main/lyrics-search
Description in README: https://github.com/DzmitryUr/react-apps?tab=readme-ov-file#unit-tests
Lyrics Search Video: https://youtu.be/OJgLNWy0oBI

⌚️Timestamps:
0:00 Introduction
0:34 Instalingl dependencies (vitest @testing-library/react)
1:15 Updating vite.config.js
1:37 Creating tests/setup.js
2:17 Updating scripts section in package.json
3:07 Creating .spec.jsx file for unit test
4:40 Adding 'describe' section
6:20 First unit test. Checking that the component renders correctly
8:45 Running unit tests with commands 'vitest run' and 'vitest' watch mode

#ReactJS #Vitest #UnitTesting #TestingLibrary #UnitTests #WebDevelopment

Видео How to add Unit Tests to Vite Project? React Unit Testing Tutorial with Testing Library and Vitest канала DevWebApp
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять