• Stars
    star
    2,297
  • Rank 19,343 (Top 0.4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 2 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Debug your Jest tests. Effortlessly.๐Ÿ› ๐Ÿ–ผ

Jest Preview Logo

Jest Preview

Debug your Jest tests. Effortlessly. ๐Ÿ› ๐Ÿ–ผ

Jest Preview Demo

Try Jest Preview Online. No downloads needed!

All Contributors

npm version npm total downloads total GitHub stars Mentioned in Awesome Jest

PRs Welcome Best of JS Discord

Try Jest Preview now

Using Vitest? Try 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:

Features

  • ๐Ÿ‘€ Preview your actual app's HTML in a browser in milliseconds.
  • ๐Ÿ”„ Auto reload browser when executing preview.debug()`.
  • ๐Ÿ’… Support CSS:
  • ๐ŸŒ„ Support viewing images.

How to use jest-preview in 2 lines of code

+import preview from 'jest-preview';

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

Or:

+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: Discord

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
Hung Viet Nguyen

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก
Truong Nguyen
Truong Nguyen

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก
Viet Huu Doan
Viet Huu Doan

๐ŸŽจ
HarveyNguyen
HarveyNguyen

โš ๏ธ
Matt Murphy
Matt Murphy

๐Ÿ“–
Traitanit Huangsri
Traitanit Huangsri

๐Ÿ’ป
Thanh Son Nguyen
Thanh Son Nguyen

๐Ÿ’ป ๐Ÿ’ก ๐Ÿ“–
Minh Nguyen
Minh Nguyen

๐Ÿ“–
Kyle(Tรฌnh Vลฉ)
Kyle(Tรฌnh Vลฉ)

๐Ÿ›
Makoto Tateno
Makoto Tateno

๐Ÿ“–
Abhishek Rawat
Abhishek Rawat

๐Ÿ“–
Huynh Duc Duy
Huynh Duc Duy

๐Ÿ’ป
Nuno Casteleira
Nuno Casteleira

๐Ÿ›
sundaycrafts
sundaycrafts

๐Ÿ’ป
LunduoCai
LunduoCai

๐Ÿ›
huyenuet
huyenuet

โš ๏ธ
Bennett Dams
Bennett Dams

๐Ÿ“–
Steven Rosato
Steven Rosato

๐Ÿ’ก ๐Ÿ›
nhducit
nhducit

๐Ÿค”
Benoit GRASSET
Benoit GRASSET

๐Ÿ›
Sergii Kirianov
Sergii Kirianov

๐Ÿ“– ๐Ÿ–‹ ๐Ÿ’ป
Kim, Harim
Kim, Harim

๐Ÿ“–
Lars Gyrup Brink Nielsen
Lars Gyrup Brink Nielsen

๐Ÿ“– ๐Ÿ’ก
Mike Shi
Mike Shi

๐Ÿ“–
Veniamin Krol
Veniamin Krol

๐Ÿ“–
Ikko Ashimine
Ikko Ashimine

๐Ÿ’ป
Pavel Shut
Pavel Shut

๐Ÿ›
David Z Hao
David Z Hao

๐Ÿ›
Rohitbels
Rohitbels

๐Ÿ’ป
Rivaldi Putra
Rivaldi Putra

๐Ÿ“–
Long Zhao
Long Zhao

๐Ÿ’ป
Justin Sun
Justin Sun

๐ŸŒ

This project follows the all-contributors specification. Contributions of any kind are welcome!

Star history

Star History Chart

License

This is open source software

MIT

Sponsors

Your financial support helps the project alive and in a development mode. Make an impact by sponsoring us $1 via Open Collective.

  • Bronze Sponsor ๐Ÿฅ‰:
  • Silver Sponsor ๐Ÿฅˆ:
    • All of these above
    • Your requests will be prioritized.
  • Gold Sponsor ๐Ÿฅ‡:
    • All of these above
    • Let's discuss your benefits for this tier, please contact the author
  • Diamond Sponsor ๐Ÿ’Ž:
    • All of these above
    • Let's discuss your benefits for this tier, please contact the author

Bronze Sponsors ๐Ÿฅ‰

Past Sponsors

More Repositories

1

vitest-preview

Debug your Vitest tests. Effortlessly. ๐Ÿงช๐Ÿ–ผโšก๏ธ
TypeScript
308
star
2

react-linkedin-login-oauth2

Easily get Authorization Code from Linked In to log in without redirecting.
TypeScript
92
star
3

react-conferences

โš› Up-to-date and Comprehensive list of React Conferences Worldwide ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป
46
star
4

jest-with-vite

Setup Jest with Vite React โšก๏ธโš›๏ธ
JavaScript
20
star
5

know-your-stargazers

Know more about who starred your repository ๐Ÿ•ต๏ธ
JavaScript
16
star
6

netlify-plugin-playwright-cache

๐Ÿค– Persist the Playwright executable between Netlify builds
JavaScript
15
star
7

vite-react-template-redux

The unofficial Redux template for Vite React
JavaScript
13
star
8

courses-i-took

Courses I took to improve my technical knowledge and skills
11
star
9

react-linkedin-login-oauth2-demo

JavaScript
7
star
10

blockchain_demo

A very simple blockchain system written in Python
Python
7
star
11

cv

๐Ÿ’ผ Hung Nguyen's Resumรฉ. Powered by Nuxt and vue-notion
Vue
6
star
12

talk-with-dwarves-foundation

Slides for the talk "Visual debugging experience for your frontend tests" hosted by Techie Story x Dwarves Foundation x WeBuild
3
star
13

sample-chat-widget

Sample Chat Widget using styled-components https://sample-chat-widget.netlify.app/
JavaScript
2
star
14

trochuyenit.hung.dev

Vietnamese tech talk podcast. Hosted by nvh95.
JavaScript
2
star
15

nvh95

2
star
16

jsconf-korea2022

Slides for the talk "How I Got 1600 Stars on GitHub in 2 months of Open Source Work". Made with @slidevjs
JavaScript
2
star
17

msw-example

JavaScript
1
star
18

handbook

JavaScript
1
star
19

messenger-clone

Rebuild Messenger using styled-components and flexbox https://messenger-demo.netlify.app/
JavaScript
1
star
20

railway_fastapi

Python
1
star
21

demo-scripts

JavaScript
1
star
22

hieu-sketches

JavaScript
1
star
23

hung.dev

Hung Viet Nguyen's Blog
TypeScript
1
star
24

react-linkedin-login-oauth2-docs

JavaScript
1
star
25

blog

Gatsby starter for a Contentful project from the community.
JavaScript
1
star
26

gi-minihackathon-team2

Created with CodeSandbox
JavaScript
1
star