{"name":"jest-specific-snapshot","version":"0.2.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":"d67f5d0eb2429309456cf9926a766991813ee360","description":"TBD","_id":"jest-specific-snapshot@0.2.0","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"igor-dv","email":"davydkin.igor@gmail.com"},"dist":{"integrity":"sha512-6cVUQ1qxF4BqqWa0U3DaY3zMsc15ynzUxrnRPq7R6fhJKOeT57FN/TnacdV+YSiqYcRPrReNRxfm/4qQ4NoIAA==","shasum":"271422a09b87cff42a70651634b70918135c6330","tarball":"http://registry-npm.ywwl.com/jest-specific-snapshot/download/jest-specific-snapshot-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDy0NBIhQvJZd3fUmT1TCbaZ3FBIUH5MvObpFa1XzmAtAIhAL20kv831N7I0EaHbeicqbagEhEW6CSB5sq0VUnPzL/L"}],"size":3003,"noattachment":false,"key":"/jest-specific-snapshot/-/jest-specific-snapshot-0.2.0.tgz"},"maintainers":[{"name":"igor-dv","email":"davydkin.igor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-specific-snapshot-0.2.0.tgz_1501688685741_0.6102849771268666"},"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":1501688686658,"_cnpm_publish_time":1501688686658,"dist-tags":{"latest":"8.0.0"}}