React Testing — Timers and Snapshots
Published in
3 min readJan 25, 2021
Automated tests are important for most apps. In this article, we’ll take a look at how to write tests for React components.
Timers
We can mock timers in our React component tests.
For example, if we have:
import React, { useEffect } from "react";export default function Card({ onSelect }) {…