Skip to content

Commit

Permalink
chore(readme): update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrutjes committed Apr 18, 2017
1 parent ce9c638 commit 6e8838b
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions README.md
Expand Up @@ -5,7 +5,7 @@

When using this Jest serializer, it will turn any string starting with '<' to nicely indented HTML in the snapshot.

This serializer is based on [js-beautify](https://github.com/beautify-web/js-beautify) and is configured to indent HTML tags as much as possible to ease readability of diffs in case of failing snapshot tests.
This serializer is based on [diffable-html](https://github.com/rayrutjes/diffable-html) which is an opinionated HTML formatter that will ease readability of diffs in case of failing snapshot tests.

## Install

Expand Down Expand Up @@ -41,7 +41,9 @@ Will output:
exports[`should beautify HTML 1`] = `
<ul>
<li>
<a href="#">My HTML</a>
<a href="#">
My HTML
</a>
</li>
</ul>
`;
Expand All @@ -60,7 +62,7 @@ const Hello = {
},
template: `
<h1>Hello ${ msg }!</h1>
<ul><li><a href="#">My HTML</a></li></ul>
<ul id="main-list" class="list"><li><a href="#">My HTML</a></li></ul>
`
};

Expand All @@ -82,15 +84,23 @@ Will output:

```js
exports[`should beautify HTML 1`] = `
<h1>Hello You!</h1>
<ul>
<h1>
Hello You!
</h1>
<ul id="main-list"
class="list"
>
<li>
<a href="#">My HTML</a>
<a href="#">
My HTML
</a>
</li>
</ul>
`;
```

You can read more about the [HTML formatting here](https://github.com/rayrutjes/diffable-html#readme).

## Special thanks

This package was inspired by the amazing post here: [Jest for all: Episode 1 — Vue.js](https://hackernoon.com/jest-for-all-episode-1-vue-js-d616bccbe186) by [Cristian Carlesso](https://hackernoon.com/@kentaromiura_the_js_guy).

0 comments on commit 6e8838b

Please sign in to comment.