{"name":"jest-specific-snapshot","version":"0.1.0","main":"dist/index.js","scripts":{"example":"jest specific.napshot.test","babel":"babel src -d dist","lint":"eslint .","lint-fix":"npm run lint -- --fix","prepublish":"npm run babel"},"jest":{"cacheDirectory":"./.jest/cache"},"dependencies":{"jest-snapshot":"^20.0.3"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-jest":"^20.0.3","babel-preset-es2015":"^6.24.1","eslint":"^4.3.0","eslint-config-airbnb-base":"^11.2.0","eslint-config-prettier":"^2.3.0","eslint-plugin-import":"^2.7.0","eslint-plugin-jest":"^20.0.3","eslint-plugin-json":"^1.2.0","eslint-plugin-prettier":"^2.1.2","eslint-teamcity":"^1.4.0","jest":"^20.0.4","jest-cli":"^20.0.4","prettier":"^1.5.3"},"peerDependencies":{"jest":"^20.0.4"},"gitHead":"bb0f6130e5cea0cd9981840a87eab762ff9491f7","description":"TBD","_id":"jest-specific-snapshot@0.1.0","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"igor-dv","email":"davydkin.igor@gmail.com"},"dist":{"integrity":"sha512-20xwgYj+vvYRRc8X4QUzYFBEfMtAGFwS+DOOxzh/zzVH+Dz3GiQiK8ZU6QA9tb6r1Ge1KlOygzmfbZeHX7VXxA==","shasum":"c3a6ab42d086c7509d1308e9480ff3f6eb9e13f4","tarball":"http://registry-npm.ywwl.com/jest-specific-snapshot/download/jest-specific-snapshot-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3jCAfwLUOPNMjrsHN48X1vLr2yVJ94qvvoGsTY+HNGwIhALLBFQv6jMghRew+S2KnpigJBXIHk6P0N5iaJkRjlgFB"}],"size":2828,"noattachment":false,"key":"/jest-specific-snapshot/-/jest-specific-snapshot-0.1.0.tgz"},"maintainers":[{"name":"igor-dv","email":"davydkin.igor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-specific-snapshot-0.1.0.tgz_1501626230958_0.6193886413238943"},"directories":{},"readme":"[![CircleCI](https://circleci.com/gh/igor-dv/jest-specific-snapshot.svg?style=svg)](https://circleci.com/gh/igor-dv/jest-specific-snapshot)\n\n---\n\n# Jest Specific Snapshot\n\nJest matcher for multiple snapshot files per test\n\n<b>You can read about the implementation [here](https://medium.com/@davydkin.igor/adding-multi-snapshot-testing-to-jest-b61f23cf17ca)</b>\n\n# Installation\n\n```sh\nnpm i -D jest-specific-snapshot\n```\n\n# Example\n\n```js\nconst path = require('path');\n// extend jest to have 'toMatchSpecificSnapshot' matcher\nrequire('jest-specific-snapshot');\n\ntest('test', () => {\n  // provides snapshot file with absolute file\n  const pathToSnap = path.resolve(process.cwd(), './example/specific/dir/my.shot');\n  expect(100).toMatchSpecificSnapshot(pathToSnap);\n\n  //same snapshot but with relative file\n  expect(14).toMatchSpecificSnapshot('./specific/dir/my.shot');\n\n  // another snapshot file in the same test\n  expect(19).toMatchSpecificSnapshot('./specific/another_dir/another.shot');\n});\n```\n\n## With Custom Serializer\n\n```js\n// extend jest to have 'toMatchSpecificSnapshot' matcher\nconst addSerializer = require('jest-specific-snapshot').addSerializer;\n\naddSerializer(/* Add custom serializer here */);\n\ntest('test', () => {\n  expect(/* thing that matches the custom serializer */).toMatchSpecificSnapshot(\n    './specific/custom_serializer/test.shot'\n  );\n});\n```\n\n## Extend `toMatchSpecificSnapshot`\n\n```js\nconst toMatchSpecificSnapshot = require('jest-specific-snapshot').toMatchSpecificSnapshot;\n\nexpect.extend({\n  toMatchDecoratedSpecificSnapshot(received, snapshotFile) {\n    // You can modify received data or create dynamic snapshot path\n    const data = doSomeThing(received);\n    return toMatchSpecificSnapshot.call(this, data, snapshotFile);\n  },\n});\n```\n\n# Limitations\n\n1.  Snapshot files should have an extension **other** than `.snap`, since it conflicts with jest.\n2.  In order to handle the `--updateSnapshot` (`-u`) parameter provided from CLI, there is an abuse of the `SnapshotState._updateSnapshot` private field. TBD - try to use the `globalConfig` to get this state.\n3.  `.toMatchSpecificSnapshot` does ignore a custom serializers strategy. In order to support custom serializers, you should use the `addSerializer` method explicitly.\n","publish_time":1501626231911,"_cnpm_publish_time":1501626231911,"dist-tags":{"latest":"8.0.0"}}