Ákos Kőművesakoskm.com·Feb 14, 2025React Component Testing with Vitest's Browser Mode and PlaywrightVitest and React Testing Library are great for component testing. We all love to see those console messages with our tests passing so we can confidently kick off that deployment. However, unit testing front-end components was always a bit tricky for ...1 like·100 readsreact router
Lewis Wrightcarbonate.hashnode.dev·Feb 11, 2025Migrating from Jest to VitestIn this tutorial, we'll guide you through the process of migrating your test suite from Jest to Vitest. We'll cover the key differences, necessary configuration changes, and how to update your tests for compatibility with Vitest. Why migrate to Vites...Jest
Ákos Kőművesakoskm.com·Dec 29, 2024React Router Vitest ExampleI'll show you how easy it is to get started with React Router 7, Vite 6, and Vitest 2. But first, do you know what’s common in React Router, Remix, and Vite? They are all key building blocks of modern React applications. React Router has been around ...1 like·110 readsvitest
Ariska Hidayattech.finlup.id·Dec 13, 2024Penggunaan setup.ts di VitestDalam Vitest, file setup.ts digunakan untuk menjalankan kode setup atau inisialisasi sebelum semua tes dijalankan. File ini sangat berguna untuk mengonfigurasi hal-hal yang bersifat global, seperti: Pengaturan Library Pihak Ketiga: Contohnya: Mengi...vitest
Peter Babinecpeterbabinec.hashnode.dev·Nov 16, 2024Writing Foolproof React TestsIntro Throughout my career, I have always felt fortunate when I had the chance to work with people who truly enjoy writing good unit tests. I could be certain of one thing: they cared about high code quality - which in turn, let me always rely on the...69 readssoftware development
Ayush Kumarnamaste-react.hashnode.dev·Oct 22, 2024Vitest : (A Vite-native testing framework)1. Vitest Scripts in package.json "scripts": { // This script runs Vitest to execute the test suite "test": "vitest", // This script runs Vitest with an additional flag --coverage // The --coverage flag generates a test coverage repo...vitest
Pawan Gangwaniblogs.pgangwani.co.in·Aug 31, 2024Creating Interactive Tests in Storybook and Reusing Them in Jest/VitestIntroduction Interactive tests in Storybook allow you to simulate user interactions and verify component behavior. By reusing these tests in Jest or Vitest, you can ensure consistency across your testing environments. This guide will walk you through...58 readsStorybook
Bruno Sabotbrunosabot.hashnode.dev·Jun 30, 2024Mastering Time: Using Fake Timers with VitestPhoto by Aron Visuals on Unsplash In the world of testing, controlling time can be a real challenge. Real-world timers, like setTimeout() and setInterval(), can be cumbersome when writing unit tests: without the right technique, you will introduce ex...JavaScript
Carlos Eduardo Burkophantodev.hashnode.dev·May 30, 2024Comparing Vitest and Jest: Which Testing Framework is Better?If you develop in JavaScript, you have several options to test your code. Two of the most popular are Jest and Vitest.😁 Which is better, Jest or Vitest? It depends on how you manage your code modules, your development environment, and how much you v...155 readsJest
Arjun Dangitechbuild.hashnode.dev·May 4, 2024Write Unit Test For React Application. (vitest, Testing-library)Here we will use the following packages for writing unit tests. Our application will be a react application that uses Tanstak-react-query for API calls. Vitest Testing-library Happy-dom Mock Server Worker (MSW) Testing API Calls In modern web a...54 readsunit testing