Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
We will walk through the process of setting up a basic React App with interactive elements such as a counter with increment/decrement buttons, and a form to post text to the DOM. I will walk through writing the Jest tests and the rest of the code here, but you can view the repo containing all of the code here
The third import, @testing-library/jest-dom/extend-expect, provides additional matchers that we can use against targeted elements. The full documentation for Jest-DOM can be found here
Related posts
- Anyone have setup instructions for Vitest + Typescript + React testing library? My setup is failing to extend matchers on Vitest Types
- Is there a jest query method for this use case?
- Unable to test React-Redux Toolkit app
- Svelte test suite setup
- Is there any way to use Jest and jest-dom together without having to transpile?