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...Discuss·32 readssoftware development
Ayush KumarforNamaste React - Blognamaste-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...Discussvitest
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...Discuss·54 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...DiscussJavaScript
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...Discuss·89 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...Discuss·35 readsunit testing
Ákos KőművesProakoskm.com·Apr 19, 2024How to test React apps with Vitest and ViteA few weeks ago, I began creating small applications for my upcoming course on Testing React applications. I aimed to make the setup simple and easy for students to follow. I started with the Babel/Jest setup, which I've used for years, but people ha...Discuss·576 readsTesting ReactReact
Sean Coughlinblog.seancoughlin.me·Apr 9, 2024FeaturedAccelerating Frontend Development with Bun and ViteRolling with Bun In the vibrant world of web development, the quest for more efficient tools and workflows is unending. Enter Bun, a modern JavaScript runtime that’s piquing the interest of developers for its all-in-one approach. But what exactly mak...Discuss·39 likes·1.4K readsWeb DevelopmentBun
DJ Scruggsdjscruggs.hashnode.dev·Mar 27, 2024CKEditor custom builds in ReactRecently I've been working on a project that uses a CKEditor custom build. While CKEditor is an impressive piece of software, React is extremely picky about how you import the library. I did a lot of trial and error to get it working on my project, s...DiscussCKEditor
Ayomide Apantakuayoapantaku.com·Mar 16, 2024Resolving "Object literal may only specify known properties, and 'test' does not exist in type 'UserConfigExport'"I was setting up tests for a Vite project using vitest and stumbled upon a very weird error while including my setup test file in the vite.config.ts: It turns out test isn't exported from UserConfigExport interface and it only allows properties defi...Discussvite