diff --git a/package.json b/package.json index 14500c5..33d82d4 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/snapshotter.js b/src/snapshotter.js index 41de965..9f0fc6d 100644 --- a/src/snapshotter.js +++ b/src/snapshotter.js @@ -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 {