2022-09-20
3026
#jest#react
Yomi Eluwande
265
Sep 20, 2022 â‹… 10 min read

React end-to-end testing with Jest and Puppeteer

Yomi Eluwande JavaScript developer. Wannabe designer and Chief Procrastinator at Selar.co and worklogs.co.

Recent posts:

Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 â‹… 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 â‹… 7 min read
Using Aoi Js To Build A Bot For Discord

Using aoi.js to build a bot on Discord

Explore how the aoi.js library makes it easy to create Discord bots with useful functionalities for frontend applications.

Rahul Padalkar
Apr 17, 2024 â‹… 9 min read
Web Components Adoption Guide: Overview, Examples, And Alternatives

Web Components adoption guide: Overview, examples, and alternatives

Evaluate Web Components, a set of standards that allow you to create custom HTML tags for more reusable, manageable code.

Elijah Asaolu
Apr 16, 2024 â‹… 11 min read
View all posts

3 Replies to "React end-to-end testing with Jest and Puppeteer"

  1. The CRA seems to have updated the App.js, the css selector is now .App-header and the content is not Welcome to React. It would be helpful if you can update the App.test.js. Thanks!

  2. How does this compare to using enzyme or react-testing-library for high-level testing?

    I use those other libraries and I end up having to manually specifying redux store state, and managing react-router as well. Which seems tedious and anti-“test emulate the user”-approach.

    What behavior should be tested by E2E testing with puppeteer and what should be tested with enzyme/RTL?

    I think we want to minimize puppeteertests because they take longer? right?

    Why not just have 3 sets of tests?
    – Puppeteer for E2E testing (anything more than a single component)
    – Enyzyme or RTL for single-component rendering
    – unit tests for things like Util functions

Leave a Reply