React Unit Testing using @testing-library/react
Jan 23, 2024 · 1 min read · Example component code:
import {useState} from 'react';
const Text = ({text}) => {
const [state, setState]= useState(0);
const add = () => {
setState(state+1)
};
return (
<div>
<h1>Hello World</h1>
...