Permalink
Browse files

Add jest-html

  • Loading branch information...
takayukii committed Mar 20, 2017
1 parent b05bbae commit ed4ca27e793744829a067debb9192f6e41511add
Showing with 415 additions and 18 deletions.
  1. +4 −1 .jestrc
  2. +6 −0 README.md
  3. +3 −1 package.json
  4. +10 −0 src/__tests__/__snapshots__/test-enzyme.js.snap
  5. +8 −0 src/__tests__/__snapshots__/test-simple.js.snap
  6. +384 −16 yarn.lock
View
@@ -1,3 +1,6 @@
{
- "snapshotSerializers": ["./node_modules/jest-serializer-enzyme"]
+ "snapshotSerializers": [
+ "./node_modules/jest-serializer-enzyme",
+ "./node_modules/jest-html"
+ ]
}
View
@@ -29,3 +29,9 @@ If you want to update snapshots, hit it with -u option.
```$xslt
$ yarn test -- -u
```
+
+To check snapshot as more like HTML, you can use jest-html
+
+```$xslt
+$ yarn jest-html
+```
View
@@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --progress --inline --hot",
- "test": "jest --config .jestrc"
+ "test": "jest --config .jestrc",
+ "jest-html": "jest-html"
},
"author": "",
"license": "ISC",
@@ -17,6 +18,7 @@
"babel-preset-react-hmre": "^1.1.1",
"enzyme": "^2.7.1",
"jest": "^19.0.2",
+ "jest-html": "^1.3.4",
"jest-serializer-enzyme": "^1.0.0",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
@@ -16,4 +16,14 @@ exports[`Greeting Hello enzyme is displayed? 1`] = `
</div>
</div>
</App>
+------------HTML PREVIEW---------------
+<App greeting="Hello enzyme">
+ <div class="container">
+ <div class="jumbotron">
+ <h1>
+ Hello enzyme
+ </h1>
+ </div>
+ </div>
+</App>
`;
@@ -12,4 +12,12 @@ exports[`Greeting Hello simple is displayed? 1`] = `
</h1>
</div>
</div>
+------------HTML PREVIEW---------------
+<div class="container">
+ <div class="jumbotron">
+ <h1>
+ Hello simple
+ </h1>
+ </div>
+</div>
`;
Oops, something went wrong.

0 comments on commit ed4ca27

Please sign in to comment.