eslint-plugin-testing-library
react-hooks-testing-library
Our great sponsors
eslint-plugin-testing-library | react-hooks-testing-library | |
---|---|---|
3 | 18 | |
956 | 5,201 | |
1.2% | 0.5% | |
8.1 | 1.5 | |
6 days ago | 3 months ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
eslint-plugin-testing-library
-
Top 3 React Testing Library mistakes I should have spotted earlier 🚀
💡 Check out this related eslint-plugin rule
-
3 tips for setting up Jest and rtl for Next.js
It's a good habit to let eslint help you out when you're coding. There is a specific eslint library for testing: eslint-plugin-testing-library Here is how you configure it.
-
Fix Your Failing Tests: A Debugging Checklist for React Testing Library
To make sure you're not missing an async with React Testing Library functions, you can use eslint-plugin-testing-library . This will warn you if you're using async unnecessarily or you're missing it entirely.
react-hooks-testing-library
-
The Art of Side Effects in React.js: Understanding and Using the useEffect Hook
While generally it's recommended to test the component using the hooks rather than the hooks themselves, sometimes you might find it necessary to test custom hooks directly. For such cases, there's React Hooks Testing Library. This library allows you to create a simple test harness for React hooks that handles running them within the body of a function component, as well as updating and unmounting them.
-
Test your React hooks with Vitest efficiently
To do so, we can install and use Render hooks from React Testing Library:
-
Domain Layer and React? Decorators to the Rescue!
Of course, you could isolate the logic inside a hook, and there's an awesome way of testing it with renderHook. But yet, you're trapped into react features, if they change their API, you will have to put your hands in your working logic and adapt some stuffs to keep up to date.
- what's your take on the tdd approach? how are tests tested ?
-
Testing Functions within Functional React Components
Relocating functions to a custom hook makes them accessible for testing (plus you’re keeping business logic separate from the UI, in accordance with best practices). There’s even a library to help with testing custom hooks: react-hooks-testing-library.
-
Testing modern ReactJS Application: Unit Testing(Part 2)
testing-library provides one more library exactly for such purpose allowing us to avoid headache and safe strength for actual testing. It is called @testing-library/react-hooks
-
Writing useful custom React hooks with TypeScript and testing them with React Testing Library
Next, we need to install react-hooks-testing-library package. It's a simple testing utility that allows testing hooks with ease. You can read more about this package here.
-
I’ve been struggling a lot learning Unit Testing, any general tip?
As for hooks, there's https://react-hooks-testing-library.com/
-
A Quick Guide to Testing Custom React Hooks
Use @testing-library/reacthooks
-
How to test React hooks ... by not testing react hooks
Now I don't need to worry about React lifecycle methods. I can test my hook if I want to, but it hardly seems worth it here. If I would, it would be easier to do so using react-hooks-testing-library
What are some alternatives?
html2canvas - Screenshots with JavaScript
zustand - 🐻 Bear necessities for state management in React
eslint-plugin-jest - ESLint plugin for Jest
redux-devtools-extension - Redux DevTools extension.
angular-testing-library - 🐙 Simple and complete Angular testing utilities that encourage good testing practices
jest - Delightful JavaScript Testing.
SurveyJS - Free Open-Source JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout that lets you load and run multiple web forms, or build your own self-hosted form management system, retaining all sensitive data on your servers. You have total freedom of choice as to the backend, because any server + database combination is fully compatible.
Immer - Create the next immutable state by mutating the current one
rematch - The Redux Framework
malabi - Tracing Based JavaScript Assertions
vue-eslint-parser - The ESLint custom parser for `.vue` files.
ionic-react-supabase-simple-storage - Supabase Storage Image Upload Tutorial Using Ionic React & Capacitor Camera