{"name":"jest-specific-snapshot","version":"2.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/igor-dv/jest-specific-snapshot.git"},"main":"dist/index.js","scripts":{"example":"jest specific.snapshot.test","babel":"babel src -d dist","lint":"eslint .","lint-fix":"npm run lint -- --fix","prepare":"npm run babel"},"jest":{"cacheDirectory":"./.jest/cache"},"dependencies":{"jest-snapshot":"^24.1.0"},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.3.3","@babel/preset-env":"^7.3.1","babel-eslint":"^10.0.1","babel-jest":"^24.1.0","eslint":"^5.14.1","eslint-config-airbnb-base":"^13.1.0","eslint-config-prettier":"^4.0.0","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^22.3.0","eslint-plugin-json":"^1.4.0","eslint-plugin-prettier":"^3.0.1","eslint-teamcity":"^2.1.0","jest":"^24.1.0","jest-cli":"^24.1.0","prettier":"^1.16.4"},"peerDependencies":{"jest":"*"},"gitHead":"427a52b21ae9594a3ee69538f5466e69f7ab8920","description":"Jest matcher for multiple snapshot files per test","bugs":{"url":"https://github.com/igor-dv/jest-specific-snapshot/issues"},"homepage":"https://github.com/igor-dv/jest-specific-snapshot#readme","_id":"jest-specific-snapshot@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.14.1","_npmUser":{"name":"igor-dv","email":"davydkin.igor@gmail.com"},"dist":{"integrity":"sha512-aXaNqBg/svwEpY5iQEzEHc5I85cUBKgfeVka9KmpznxLnatpjiqjr7QLb/BYNYlsrZjZzgRHTjQJ+Svx+dbdvg==","shasum":"425fe524b25df154aa39f97fa6fe9726faaac273","tarball":"http://registry-npm.ywwl.com/jest-specific-snapshot/download/jest-specific-snapshot-2.0.0.tgz","fileCount":9,"unpackedSize":7863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc6taCRA9TVsSAnZWagAARPEP/26GYl5uq78hyFlENOu8\nk6OZH9rjTljJd5XJoY9/JWfp+LjvbHBiCzs3owktCVZJtYX24lHrp53lllBP\nfbDp67sMN1eUDZ4ZEz3ofi2IbOQp9AR3A6IIW+cTjOreDlGPBhCRMa5SLki8\n5QZ6Jm5xId/5HoXdS2Kz+EX24KKP654QknscPZ98YmTmLdyu74AReIKKhLpX\nYlxklR3z6zZhrPCe+/PqVFcx9r4eunDayfVcUpmog30hI509HfYdAFAOXWmu\ns6yMuhQtNZO3J36+fuzq+AG79VEeo3BRLMhAUdYr2BXaN79rcRJ2ZsHKx+X6\n2SOgplWu44WGZ8+/eRX9vwdF5MZ18Ry0vGG5wROZyDmSZxNnkfh3NT53Pvjz\n/oJmxWMoMrHNIayKuxw46AsTL0umuypbm9oQC36kyuC7XpPZY/MqLhEJCvmY\nYEJcOfqwkkVFf/w+/TXKnoEjGKo4A+INYz4qAN51g8UgA6+PSgjVF04R1CUp\n9Bd1tlKzeqx02GE5NGMFB7EeX19/W2rAlB9r2XCelOHNcGJyPiraLXsGbGOt\nu/H1WcjGOtjm0pQ12ceboyrmXfkzcvYdUxQQ76doaygQD9yA6cZ+NlzhuSDV\nQYPIi2j1armWsLakSSQ9gbM4ffHGEAMaAiO/h9t2PjxzjRlmGb8C4/NCzF2I\nMZpj\r\n=Y9ZA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyWAaJmOhqf8/glvlNeSWNT2pqygwjeampdb8GYVqb/gIhALUlWk/ElIBe02jbPai6yDrghcyhAeTbu2O+yfqnkYX8"}],"size":3536,"noattachment":false,"key":"/jest-specific-snapshot/-/jest-specific-snapshot-2.0.0.tgz"},"maintainers":[{"name":"igor-dv","email":"davydkin.igor@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-specific-snapshot_2.0.0_1551084378145_0.242390312501491"},"_hasShrinkwrap":false,"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":1551084378298,"_cnpm_publish_time":1551084378298,"dist-tags":{"latest":"8.0.0"}}