Code Monkey home page Code Monkey logo

jest-preview's Introduction

Jest Preview Logo

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

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

๐Ÿ“–

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 Sponsor ๐Ÿฅ‰

jest-preview's People

Contributors

abeplays avatar allcontributors[bot] avatar bennettdams avatar dependabot[bot] avatar eltociear avatar huyenuet avatar huynhducduy avatar iicdii avatar imgbotapp avatar layzeedk avatar makotot avatar mattmurph9 avatar mikeshi42 avatar minhmo1620 avatar ntt261298 avatar nvh95 avatar rohitbels avatar skirianov avatar srosato avatar sundaycrafts avatar vadhe avatar vkrol avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.