jest-serializer-html
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -0,1 +1,5 @@ | ||
# 3.0.0 | ||
- Switched to [diffable-html](https://github.com/rayrutjes/diffable-html) to handle the HTML formatting | ||
# 2.0.0 | ||
@@ -2,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
var beautify = require('js-beautify').html; | ||
var toDiffableHtml = require('diffable-html'); | ||
@@ -8,8 +8,4 @@ module.exports = { | ||
print(val) { | ||
return beautify(val, { | ||
unformatted: [], | ||
wrap_attributes: 'force-aligned', | ||
indent_size: 2 | ||
}); | ||
return toDiffableHtml(val); | ||
}, | ||
}; |
{ | ||
"name": "jest-serializer-html", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Jest snapshot serializer that beautifies HTML.", | ||
@@ -37,3 +37,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"js-beautify": "^1.6.12" | ||
"diffable-html": "^1.0.0" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
@@ -8,3 +8,3 @@ # A Jest snapshot serializer that beautifies HTML. | ||
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. | ||
@@ -45,3 +45,5 @@ ## Install | ||
<li> | ||
<a href="#">My HTML</a> | ||
<a href="#"> | ||
My HTML | ||
</a> | ||
</li> | ||
@@ -65,3 +67,3 @@ </ul> | ||
<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> | ||
` | ||
@@ -88,6 +90,12 @@ }; | ||
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> | ||
@@ -98,4 +106,6 @@ </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). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3824
107
9
1
+ Addeddiffable-html@^1.0.0
+ Addeddiffable-html@1.0.0(transitive)
+ Addeddom-serializer@0.2.2(transitive)
+ Addeddomelementtype@1.3.12.3.0(transitive)
+ Addeddomhandler@2.4.2(transitive)
+ Addeddomutils@1.7.0(transitive)
+ Addedentities@1.1.22.2.0(transitive)
+ Addedhtmlparser2@3.10.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedjs-beautify@^1.6.12
- Removed@isaacs/cliui@8.0.2(transitive)
- Removed@one-ini/wasm@0.1.1(transitive)
- Removed@pkgjs/parseargs@0.11.0(transitive)
- Removedabbrev@2.0.0(transitive)
- Removedansi-regex@5.0.16.1.0(transitive)
- Removedansi-styles@4.3.06.2.1(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcommander@10.0.1(transitive)
- Removedconfig-chain@1.1.13(transitive)
- Removedcross-spawn@7.0.3(transitive)
- Removedeastasianwidth@0.2.0(transitive)
- Removededitorconfig@1.0.4(transitive)
- Removedemoji-regex@8.0.09.2.2(transitive)
- Removedforeground-child@3.3.0(transitive)
- Removedglob@10.4.5(transitive)
- Removedini@1.3.8(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjackspeak@3.4.3(transitive)
- Removedjs-beautify@1.15.1(transitive)
- Removedjs-cookie@3.0.5(transitive)
- Removedlru-cache@10.4.3(transitive)
- Removedminimatch@9.0.19.0.5(transitive)
- Removedminipass@7.1.2(transitive)
- Removednopt@7.2.1(transitive)
- Removedpackage-json-from-dist@1.0.0(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedpath-scurry@1.11.1(transitive)
- Removedproto-list@1.2.4(transitive)
- Removedsemver@7.6.3(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedsignal-exit@4.1.0(transitive)
- Removedstring-width@4.2.35.1.2(transitive)
- Removedstrip-ansi@6.0.17.1.0(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwrap-ansi@7.0.08.1.0(transitive)