Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/raathigesh/jest-tools

🔧 VSCode extension for inspecting DOM of Jest tests
https://github.com/raathigesh/jest-tools

developer-tools dx jest

Last synced: 4 months ago
JSON representation

🔧 VSCode extension for inspecting DOM of Jest tests

Awesome Lists containing this project

README

        

Jest tools let you inspect html from your Jest tests with ease when logging to console is not enough.

### Getting started

- Install the [VSCode extension.](https://marketplace.visualstudio.com/items?itemName=Raathigeshan.jest-tools)
- From VSCode's command palette, run the `Jest tools: Start jest tools` command.
- This will show you the Jest tools UI. **The initial screen will ask you to start Jest with additional command line arguments (A custom jest reporter to capture console logs).**
- Then simply `console.log()` a html string and it will appear in the inspector.

#### An example usage

Logging the entire body content after rendering a component.

```javascript
import { render } from '@testing-library/react';

test('should work', () => {
render();
console.log(document.body.innerHtml); // this html will appear in jest tools
});
```

### Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Raathi Kugarajan

💻 📖 🤔 🚇 🚧

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!