Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

jest-preview

> 前端框架
Open source

Debug your Jest tests. Effortlessly.

2.4K stars0 likes1 views
WebsiteGitHub

About

Debug your Jest tests. Effortlessly.

Jest Preview

Debug your Jest tests. Effortlessly.

Try Jest Preview Online. No downloads needed!

_Using Vitest? Try [Vitest Preview](https://github.com/nvh95/vitest-preview)_

Why jest-preview

When writing tests using Jest, we usually debug by reading the HTML code. Sometimes, the HTML is too complicated to visualize the UI in our head. jest-preview previews your Jest tests right in a browser, then you can see your actual UI visually, which helps you write and debug Jest tests faster.

jest-preview is initially designed to work with Jest and react-testing-library. The package is framework-agnostic, and you can use it with any frontend frameworks and testing libraries. For examples:

  • Vite React
  • Create React App
  • Nextjs
  • Svelte
  • Angular
  • Vue

Features

  • Preview your actual app's HTML in a browser in milliseconds.
  • Auto reload browser when executing preview.debug()`.
  • Support CSS:
  • ✅ Direct CSS import
  • ✅ Number of CSS-in-JS libraries, such as:
    • ✅ Styled-components
    • ✅ Emotion
  • ✅ Global CSS
  • ✅ CSS Modules
  • ✅ Sass
  • Support viewing images.

How to use jest-preview in 2 lines of code

diff
+import preview from 'jest-preview';

describe('App', () => {
  it('should work as expected', () => {
    render(<App />);
+    preview.debug();
  });
});

Or:

diff
+import { debug } from 'jest-preview';

describe('App', () => {
  it('should work as expected', () => {
    render(<App />);
+    debug();
  });
});

You also need to start the Jest Preview Server by running the CLI jest-preview. Please continue to read Usage for the details instructions.

Feedback

Your feedback is very important to us. Please help jest-preview becomes a better software by submitting feedback here.

Installation

See the Installation Guide on Jest Preview official website.

Usage

See the Usage Guide on Jest Preview official website.

Advanced configurations

Jest Preview comes with Pre-configured transformation. However, in more advanced use cases where you have custom code transformation, check out the Code Transformation Guide.

Upcoming features

  • Support more css-in-js libraries.
  • Multiple previews.
  • You name it.

Support

Please file an issue, or add a new discussion if you encounter any issues.

You can also mention @JestPreview or @hung_dev on Twitter if you want to have some more discussions or suggestions.

We also have a Discord server:

Contributing

We can't wait to see your contributions. See the Contribution Guide at CONTRIBUTING.md

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Hung Viet Nguyen


Truong Nguyen


Viet Huu Doan


HarveyNguyen

⚠️

Matt Murphy


Traitanit Huangsri


Thanh Son Nguyen


Minh Nguyen


Kyle(Tình Vũ)


Makoto Tateno


Abhishek Rawat


Huynh Duc Duy


Nuno Casteleira


sundaycrafts


LunduoCai


huyenuet

⚠️

Bennett Dams


Steven Rosato


nhducit


Benoit GRASSET


Sergii Kirianov


Kim, Harim


Lars Gyrup Brink Nielsen


Mike Shi


Veniamin Krol


Ikko Ashimine


Pavel Shut


David Z Hao

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptangularcssdebugfrontend

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架