UNPKG

react-testing-library

Version:

Simple and complete React DOM testing utilities that encourage good testing practices.

10 lines (7 loc) 231 B
import {act} from '..' jest.mock('react-dom/test-utils', () => ({})) test('act works even when there is no act from test utils', () => { const callback = jest.fn() act(callback) expect(callback).toHaveBeenCalledTimes(1) })