Jest Preview screenshot

Jest Preview

Author Avatar Theme by Nvh95
Updated: 2 Mar 2025
2396 Stars

Debug your Jest tests. Effortlessly.

Categories

Overview:

Jest-preview is a tool designed to help with writing and debugging Jest tests by previewing the actual UI in a browser. It works with Jest and react-testing-library but is flexible to use with different frontend frameworks and testing libraries.

Features:

  • Preview in Browser: Visualize your actual app’s HTML in a browser in milliseconds.
  • Auto Reload: Browser auto-reloads when executing preview.debug().
  • CSS Support: Direct CSS import, support for CSS-in-JS libraries like Styled-components, Emotion, global CSS, CSS Modules, and Sass.
  • Image Viewing: Support for viewing images.

Installation:

To install jest-preview, run the following command:

npm install jest-preview

Summary:

Jest-preview is a valuable tool for developers using Jest for testing. It provides a convenient way to visualize UI elements while writing and debugging tests, enhancing the testing process. With its support for various frontend frameworks and CSS libraries, jest-preview offers flexibility and ease of use for developers seeking to improve their testing workflow.