<commit_before># jest-html [![Build Status](https://travis-ci.org/guigrpa/jest-html.svg?branch=master)](https://travis-ci.org/guigrpa/jest-html) [![npm version](https://img.shields.io/npm/v/jest-html.svg)](https://www.npmjs.com/package/jest-html)

Preview Jest snapshots right in your browser. **Compatible with Jest 17 and higher**

![Jest-HTML and Chrome's devtools](https://raw.githubusercontent.com/guigrpa/jest-html/master/docs/02.png)

## Why?

* **Preview of React component snapshots in your browser** (snapshots and browser devtools, yay!).
* **Compatible with non-React** snapshots as well.
* **Snapshot diffing (both HTML and raw)** and visible indicators that a descendant suite or snapshot has changed.
* **Custom CSS** stylesheets applicable to all snapshots or individual ones.
* **Intuitive navigation** through folders, snapshot suites, and even **snapshot groups** within a suite.
* **Real-time updates** whenever a snapshot or CSS file changes.
* **Quickly toggle** between the raw snapshots and the HTML previews.

## Installation

Add `jest-html` to your development dependencies:

```sh
$ npm install --save-dev jest-html

# or if you use yarn:
$ yarn add jest-html --dev
```

Add the following configuration to your `package.json` (no need to replace `<rootDir>` with anything else):

```json
{
  "jest": {
    "snapshotSerializers": ["<rootDir>/node_modules/jest-html"]
  },
  "scripts": {
    "jest-html": "jest-html"
  }
}
```

## Basic usage

By adding `jest-html` to your `snapshotSerializers`, HTML previews will be automatically appended to React component snapshots the next time you update them (`jest -u`).

To review your snapshots, run `npm run jest-html` (`yarn run jest-html`). This launches your default browser and opens the `jest-html` application.
<commit_msg>Readme: remove the need for <rootDir> (#6)<commit_after># jest-html [![Build Status](https://travis-ci.org/guigrpa/jest-html.svg?branch=master)](https://travis-ci.org/guigrpa/jest-html) [![npm version](https://img.shields.io/npm/v/jest-html.svg)](https://www.npmjs.com/package/jest-html)

Preview Jest snapshots right in your browser. **Compatible with Jest 17 and higher**

![Jest-HTML and Chrome's devtools](https://raw.githubusercontent.com/guigrpa/jest-html/master/docs/02.png)

## Why?

* **Preview of React component snapshots in your browser** (snapshots and browser devtools, yay!).
* **Compatible with non-React** snapshots as well.
* **Snapshot diffing (both HTML and raw)** and visible indicators that a descendant suite or snapshot has changed.
* **Custom CSS** stylesheets applicable to all snapshots or individual ones.
* **Intuitive navigation** through folders, snapshot suites, and even **snapshot groups** within a suite.
* **Real-time updates** whenever a snapshot or CSS file changes.
* **Quickly toggle** between the raw snapshots and the HTML previews.

## Installation

Add `jest-html` to your development dependencies:

```sh
$ npm install --save-dev jest-html

# or if you use yarn:
$ yarn add jest-html --dev
```

Add the following configuration to your `package.json`:

```json
{
  "jest": {
    "snapshotSerializers": ["jest-html"]
  },
  "scripts": {
    "jest-html": "jest-html"
  }
}
```

## Basic usage

By adding `jest-html` to your `snapshotSerializers`, HTML previews will be automatically appended to React component snapshots the next time you update them (`jest -u`).

To review your snapshots, run `npm run jest-html` (`yarn run jest-html`). This launches your default browser and opens the `jest-html` application.

{'fraction_non_alphanumeric': 0.13498312710911137, 'fraction_numerical': 0.002530933633295838, 'mean_word_length': 4.619273301737756, 'pattern_counts': {'":': 8, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5461604', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1054, 'n_words': 382}