react-testing-library VS jest

Compare react-testing-library vs jest and see what are their differences.

react-testing-library

🐐 Simple and complete React DOM testing utilities that encourage good testing practices. (by testing-library)
Our great sponsors
  • Sonar - Write Clean JavaScript Code. Always.
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • Zigi - Close all those tabs. Zigi will handle your updates.
  • Scout APM - Truly a developer’s best friend
react-testing-library jest
12 353
17,208 40,779
1.2% 1.2%
5.8 9.9
about 1 month ago 5 days ago
JavaScript TypeScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.

react-testing-library

Posts with mentions or reviews of react-testing-library. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-05-10.

jest

Posts with mentions or reviews of jest. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-27.
  • How I go with react native in late 2022
    33 projects | dev.to | 27 Nov 2022
    There's nothing better than jest and testing-library/react-native in react-native. these tools are suitable for unit and integration tests and they have great community support, utils, and helper functions.
  • Adding Tests for ESM using Jest framework
    2 projects | dev.to | 25 Nov 2022
    Jest is a testing framework for Javascript projects. It ensures that the implemented core functionality of the codebase is not prone to errors by allowing developers to write convenient tests.
  • Nodejs Boilerplate with Typescript and Express
    4 projects | dev.to | 24 Nov 2022
    Jest
  • OSD600 - Telescope - Testing for feed URLs
    4 projects | dev.to | 20 Nov 2022
    However, while running the tests using jest would result in a pass, the expectations would actually fail and the failure result would show up after the tests have already ended. I was confused as to why was happening for a while. Eventually, I noticed this in the file:
  • Auto-run Tests: Test Via Continuous Integration
    2 projects | dev.to | 17 Nov 2022
    There was another repo I tried to add test for, and it uses the same setup as mine. It uses JavaScript and achieve CI via GitHub Action, except that it also run test for version 14.x and 16.x of Node.js. Given both repo use Jest for testing, It's pretty easy to write test for the repo. I needed to spend time to understand the code and then run test coverage and see the existing tests to see what's needed to be done.
  • Making sure izyum is fresh
    3 projects | dev.to | 14 Nov 2022
    Two testing engines are usually used for testing purposes in the ECMAScript world which are jest and mocha. I had previous experience with both of them and to be honest I don't see big differences between them on the basic level. I decided to go with it just because it is more popular and I did use it with typescript before so I did know it had good types of support.
  • Conditional Logging to the JavaScript Console
    4 projects | dev.to | 14 Nov 2022
    The console created by createDebugConsole will not be active in unit tests, so you won't be able to use it to prevent logging in your test environment. If you use jest you can silence console methods with the jest CLI.
  • Ng-News: Episode 22/45
    2 projects | dev.to | 14 Nov 2022
    Jest 29.3 Release Notes
  • JavaScript testing with Jest
    3 projects | dev.to | 13 Nov 2022
    I chose Jest, as it is one of the most used testing frameworks for JavaScript and most of my tool's logic is written in JS. It was developed by Facebook and is open-source. Jest also has CLI option for checking coverage which is very great, it shows which lines of code have been tested and not and prints a beautiful report.
  • DPS909 Blog - Lab 8: Testing
    2 projects | dev.to | 11 Nov 2022
    The testing framework that I chose for the project is Jest. Jest is a testing framework originally developed by Facebook for React UI testing. However, now it's its own tool that is used for any type of JavaScript project, including Node.js. I mostly chose it because of it's snapshot capabilities that allow you test whether UI elements on a page change unexpectedly.

What are some alternatives?

When comparing react-testing-library and jest you can also consider the following projects:

tap - Test Anything Protocol tools for node

vitest - A Vite-native test framework. It's fast!

Cucumber.js - Cucumber for JavaScript

Sinon.JS - Test spies, stubs and mocks for JavaScript.

nyc - the Istanbul command line interface

WebdriverIO - Next-gen browser and mobile automation test framework for Node.js

ava - Node.js test runner that lets you develop with confidence 🚀

nightwatch - End-to-end testing framework written in Node.js and using the W3C Webdriver API

istanbul - Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.

Cypress - Fast, easy and reliable testing for anything that runs in a browser.

mocha - ☕️ simple, flexible, fun javascript test framework for node.js & the browser

Protractor - E2E test framework for Angular apps