Description
Jest Preview is a debugging tool that shows your Jest test output as a real page in a browser. When you write tests with Jest and react-testing-library, you usually read the HTML to understand the UI, which gets hard when the markup is complicated. Jest Preview renders the HTML from your test in the browser so you can see the UI, and it reloads the browser when you call the debug function in a test. It was designed for Jest and react-testing-library, but the package is framework-agnostic and the README gives examples for Vite React, Create React App, Next.js, Svelte, Angular and Vue. It supports CSS imported directly, several CSS-in-JS libraries including styled-components and Emotion, global CSS, CSS Modules and Sass, and it can show images. You use it in a couple of lines of code and start the Jest Preview server with its CLI. The project is on GitHub, and a version is available to try online without downloads.…
Highlights
- Previews Jest test HTML in a browser
- Auto-reloads the browser on debug
- Supports CSS, CSS-in-JS, CSS Modules and Sass
- Works with React, Vue, Svelte and Angular
- Try it online without downloads
Ratings & Reviews
No ratings yet
Be the first to rate jest-preview.
People also visit
jest-preview FAQ
What is Jest Preview?
A tool that shows your Jest test UI in a browser, so you can see the rendered page instead of reading HTML.
How do I set it up?
Add it in two lines of code in your tests, and start the Jest Preview server with its CLI.
Which frameworks does it work with?
It works with Jest and react-testing-library, and the README includes examples for Vite React, Create React App, Next.js, Svelte, Angular and Vue.
Does it support styles?
Yes. It supports directly imported CSS, styled-components, Emotion, global CSS, CSS Modules and Sass, and it can show images.
Do I need to install anything to try it?
No. The README links an online version to try without downloads.
What are the best jest-preview alternatives?
Popular alternatives to jest-preview include ts-jest, swc-angular and jest-preset-angular. See all jest-preview alternatives





















