Skip to content

Commit

Permalink
Merge pull request #3 from derekjuber/pin_enzyme_to_json
Browse files Browse the repository at this point in the history
Pin enzyme-to-json version, set noKey to true to prevent keys from being written
  • Loading branch information
cdlewis authored Nov 7, 2017
2 parents e27c73d + dd0b1bb commit ac460aa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/snapshotter.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var maybeUpdateSnapshot = function maybeUpdateSnapshot(snapshotPath, relativeSna
module.exports = function (assert, component, id) {
var outputBuffer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _process2.default.stdout;

var serialisedComponent = JSON.parse(stringify((0, _enzymeToJson.shallowToJson)(component)));
var serialisedComponent = JSON.parse(stringify((0, _enzymeToJson.shallowToJson)(component, { noKey: true })));

var _getSnapshotPath = (0, _getSnapshotPath3.default)(id),
snapshotPath = _getSnapshotPath.snapshotPath,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snapshotter",
"version": "2.0.0",
"version": "2.0.1",
"description": "Snapshot testing for Tape",
"main": "dist/snapshotter.js",
"scripts": {
Expand All @@ -18,7 +18,7 @@
"url": "https://github.com/cdlewis/snapshotter.git"
},
"dependencies": {
"enzyme-to-json": "^3.1.3",
"enzyme-to-json": "3.1.3",
"jest-diff": "^18.1.0",
"jest-file-exists": "^17.0.0",
"lodash": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/snapshotter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const maybeUpdateSnapshot = (snapshotPath, relativeSnapshotPath, component) => {
}

module.exports = (assert, component, id, outputBuffer = process.stdout) => {
const serialisedComponent = JSON.parse(stringify(shallowToJson(component)))
const serialisedComponent = JSON.parse(stringify(shallowToJson(component, { noKey: true })))
const { snapshotPath, relativeSnapshotPath } = getSnapshotPath(id)

try {
Expand Down

0 comments on commit ac460aa

Please sign in to comment.