Never miss a release that matters
AI-powered summaries of every GitHub release.
AI Summaries
Changelogs condensed into clear, actionable insights.
Always Free
Track up to 5 packages at no cost, forever.
Weekly Digest
A curated summary of every release, delivered weekly.
TL;DR
Testing Library now fully supports React 19, resolving a type inference issue with error handling.
Fixes Worth Knowing
Resolved a type inference problem with onCaughtError (error handling callback) when using React 19. This ensures correct type checking and prevents potential issues when handling errors in your tests.
TL;DR
React Testing Library now correctly handles React.act (React’s concurrency mechanism) in all cases, resolving potential issues with asynchronous updates in tests.
Fixes Worth Knowing
Resolved a bug where tests could fail or behave unexpectedly when using React.act with certain React versions. The library now dynamically exports the correct act function, ensuring compatibility and reliable test execution.
TL;DR
Testing Library now supports React 19 Canary, allowing you to test applications using the latest React features.
New
- Support for React 19 Canary (pre-release version of React).
Fixes Worth Knowing
- Fixed an issue with nullish coalescing operators that could cause unexpected behavior in tests.
TL;DR
Upgrading to the latest version improves test stability by addressing potential "missing act" warnings and incorporates updates from @testing-library/dom (DOM manipulation library).
Breaking
@testing-library/domv9.0.0 introduces breaking changes – review https://github.com/testing-library/dom-testing-library/releases/tag/v9.0.0 before upgrading.
Fixes Worth Knowing
- Resolved an issue causing false "missing act" warnings when using queued microtasks, improving test reliability.
TL;DR
Testing Library now requires Node.js 14 or higher, improving performance and allowing us to leverage newer JavaScript features.
Breaking
- Node.js 12.x is no longer supported (minimum version is now 14.x).
Before You Upgrade
- Update your Node.js version to 14 or higher before upgrading Testing Library.
TL;DR
renderHook now accepts all render options, giving you more control over how your custom hooks are tested (custom hooks are reusable logic).
New
renderHooknow supports all render options, matching the flexibility ofrender.
TL;DR
Testing Library now only supports React versions prior to 18, addressing a compatibility issue.
Fixes Worth Knowing
- Resolved a bug where the library was incompatible with React 18 (latest React version).
TL;DR
This release drops support for Node 10, requiring users to upgrade to a supported version (Node 12+) to continue using Testing Library.
Breaking
- Node 10 support removed (end-of-life).
Before You Upgrade
Ensure you are using Node version 12 or higher before upgrading.
TL;DR
Testing Library now uses an updated internal dom implementation, improving compatibility and stability.
Fixes Worth Knowing
Resolved an issue with the underlying dom library (handles browser-like environments) that could cause unexpected behavior in some tests.
TL;DR
Testing Library now handles environments where process is undefined, improving compatibility with various testing setups.
Fixes Worth Knowing
Fixed an issue where tests would fail in environments lacking a process object (Node.js environments). This improves reliability when running tests in uncommon configurations.
TL;DR
Testing Library now includes updated dependencies, improving stability and resolving potential issues with common DOM interactions (browser behavior).
Fixes Worth Knowing
Updated dependencies address potential issues when interacting with elements in the browser, improving test reliability.
Before You Upgrade
No action is needed; this is a dependency update and should work seamlessly with existing tests.
TL;DR
This release updates Testing Library to drop support for Node 8 and removes the deprecated cleanup-after-each function, while also improving test cleanup by flushing microtasks.
Breaking
- Node Support: Node 8 is no longer supported (requires Node 10+).
cleanup-after-each: Removed deprecated function (no action needed if not used).- DOM Testing Library: Updates to the latest version may introduce breaking changes; review its changelog.
New
- Microtask Flushing: Test cleanup now flushes microtasks for more reliable results (improves test stability).
Before You Upgrade
- Ensure your Node version is 10 or greater.
- Review the changelog for
@testing-library/domfor potential breaking changes.
TL;DR
The debug function now accepts the same arguments as prettyDOM (a debugging utility), improving flexibility when inspecting component states during tests.
New
- The
debugfunction now accepts arguments, matching theprettyDOMfunction’s API for more control during test debugging.
TL;DR
Testing Library now handles component unmounting more reliably with improved async act integration, preventing potential issues with state updates after tests complete.
Fixes Worth Knowing
- Resolved an issue where components weren’t always fully cleaned up after tests, which could lead to unexpected behavior in subsequent tests.
- Updated a warning message to inform users they can now upgrade to React 16.9.0 (latest React version).
TL;DR
Testing Library updates its internal dependencies, ensuring compatibility and stability for existing tests.
Fixes Worth Knowing
Updated the dom-testing-library dependency to resolve a compatibility issue, preventing potential test failures.
TL;DR
Testing Library now supports async act (concurrent rendering), enabling tests for components using asynchronous updates within React’s act environment.
New
- Async Act Support: Test components that perform asynchronous state updates using
act(React’s unit of work).
Fixes Worth Knowing
- React DOM Compatibility: Improved compatibility with React DOM, resolving issues related to requiring test utilities.
- Act Wrapper: Corrected how results are returned from the
actwrapper, ensuring tests execute as expected.
TL;DR
The testHook API now supports a wrapper component, enabling more flexible and realistic testing of React hooks (reusable logic).
New
testHooknow accepts awrapperoption, allowing you to render a component around the hook under test.testHooknow returns a ref object to the hook’s result, providing direct access to its values.
Before You Upgrade
If you are using testHook, review your tests to see if wrapping the hook in a component improves their accuracy or coverage.
TL;DR
React Testing Library no longer uses Simulate.change, improving compatibility and aligning with current React best practices for simulating input changes.
Fixes Worth Knowing
- The
renderfunction now returns the base element, allowing easier access to the rendered component for specific queries or manipulations. - Updated dependencies to ensure compatibility and stability (dom-testing-library).
TL;DR
Testing Library now fully supports React Portals, enabling tests for components rendered outside the main DOM (like modals).
Fixes Worth Knowing
- TypeScript definitions have been improved with exported interfaces and typings, enhancing the developer experience (code hinting/validation).
- Resolved an issue preventing tests from correctly interacting with React Portal elements.
- Updated Node.js engine support.
TL;DR
Testing Library now includes a rerender function, allowing you to re-execute your component’s render logic during a test to verify updates and side effects.
New
rerenderfunction: Allows re-rendering of a component (useful for state updates).- Context examples: Added illustrative examples for testing components using React Context (data sharing).
Fixes Worth Knowing
- TypeScript definitions: Improved type definitions for better support when using TypeScript (a JavaScript superset). This includes fixes for
getByTestId.
TL;DR
Testing Library now includes getByAltText (a query method) and a toHaveAttribute custom matcher, improving accessibility and attribute-based testing.
New
getByAltText: New query method for finding elements by theiralttext.toHaveAttribute: Custom matcher for asserting the presence of specific HTML attributes.
Fixes Worth Knowing
- The library now correctly supports elements with
aria-labelattributes. - Fixed issues with text matching when the search term isn’t a string.
- Improved error messages for matcher failures.
TL;DR
React Testing Library is now available, providing a lightweight solution for testing React components by focusing on user behavior rather than implementation details.
New
- Provides an alternative to enzyme for testing React components.
- Encourages tests that resemble how users interact with the application.