To use DOM Testing Library with Preact, we’ll write a custom render function that utilizes the getQueriesForElement function. Because preact re-renders asynchronously, we’ll use a custom fireEventAsync function to ensure that the app has re-rendered after every event we fire. If you like this, checkout preact-testing-library.

If you like this, checkout Preact Testing Library.