
Security News
Inside Lodash’s Security Reset and Maintenance Reboot
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.
@solidjs/testing-library
Advanced tools
Simple and complete Solid testing utilities that encourage good testing practices.
Simple and complete Solid DOM testing utilities that encourage good testing practices.
Inspired completely by preact-testing-library
You want to write tests for your Solid components so that they avoid including implementation details, and are maintainable in the long run.
The Solid Testing Library is a very lightweight solution for testing Solid components. Its primary guiding principle is:
The more your tests resemble the way your software is used, the more confidence they can give you.
This module is distributed via npm which is bundled with node and should be installed
as one of your project's devDependencies:
npm install --save-dev @solidjs/testing-library
If you using Jest we recommend using solid-jest to properly resolve the browser version of Solid as Jest will default to the server version when run in Node.
💡 If you are using Jest or vitest, you may also be interested in installing @testing-library/jest-dom so you can use
the custom jest matchers.
A working Vite template setup with solid-testing-library and TypeScript support can be found here.
See the docs over at the Testing Library website.
There are several key differences, though:
⚠️ The render function takes in a function that returns a Solid Component, rather than simply the component itself.
// With @testing-library/preact
const results = render(<YourComponent />, options);
// With solid-testing-library
const results = render(() => <YourComponent />, options);
⚠️ Solid.js does not rerender, it merely executes side effects triggered by reactive state that change the DOM, therefore there is no rerender method. You can use global signals to manipulate your test component in a way that causes it to update.
Solid.js' reactive changes are pretty instantaneous, so there is rarely need to use waitFor(…) or await findByRole(…) - with the exception of transitions and Suspense.
⚠️ Solid.js external reactive state does not require any DOM elements to run in, so our renderHook call has no container, baseElement or queries in its options or return value. Instead, it has an owner to be used with runWithOwner if required. It also exposes a cleanup function, though this is already automatically called after the test is finished.
If you find any issues, please check on the issues page if they are already known. If not, opening an issue will be much appreciated, even more so if it contains a
If you think you can fix an issue yourself, feel free to open a pull-request. If functionality changes, please don't forget to add or adapt tests.
Thanks goes to Kent C. Dodds and his colleagues for creating testing-library and to the creators of preact-testing-library.
This library has been created by Ryan Carniato and is currently maintained by Alex Lohr.
FAQs
Simple and complete Solid testing utilities that encourage good testing practices.
The npm package @solidjs/testing-library receives a total of 49,970 weekly downloads. As such, @solidjs/testing-library popularity was classified as popular.
We found that @solidjs/testing-library demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.

Security News
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.