Relative Content

Tag Archive for reactjsreact-testing-libraryvitest

How is a component with multiple setInterval() tested?

There are two setInterval() functions within a component I’m working on. Once the function start_new_game sets the component state variable level equal to '0', the component will invoke useEffect. The state setter within the effect, setActiveColor, sets a state variable which is used to conditionally set the css classes on a button.