{"name":"jest-specific-snapshot","version":"4.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/igor-dv/jest-specific-snapshot.git"},"main":"dist/index.js","scripts":{"test":"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":"^26.3.0"},"devDependencies":{"@babel/cli":"^7.8.4","@babel/core":"^7.8.4","@babel/preset-env":"^7.8.4","babel-eslint":"^10.0.3","babel-jest":"^25.1.0","eslint":"^6.8.0","eslint-config-airbnb-base":"^14.0.0","eslint-config-prettier":"^6.10.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.8.0","eslint-plugin-json":"^2.1.0","eslint-plugin-prettier":"^3.1.2","eslint-teamcity":"^2.2.0","jest":"^26.3.0","prettier":"^1.19.1"},"peerDependencies":{"jest":">= 26.0.0"},"gitHead":"f62668ef971c87d5cfd454d1673b9cc5dec3aace","description":"[![CircleCI](https://circleci.com/gh/igor-dv/jest-specific-snapshot.svg?style=svg)](https://circleci.com/gh/igor-dv/jest-specific-snapshot)","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@4.0.0","_nodeVersion":"12.13.1","_npmVersion":"6.12.1","dist":{"integrity":"sha512-YdW5P/MVwOizWR0MJwURxdrjdXvdG2MMpXKVGr7dZ2YrBmE6E6Ab74UL3DOYmGmzaCnNAW1CL02pY5MTHE3ulQ==","shasum":"a52a2e223e7576e610dbeaf341207c557ac20554","tarball":"http://registry-npm.ywwl.com/jest-specific-snapshot/download/jest-specific-snapshot-4.0.0.tgz","fileCount":10,"unpackedSize":9900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM6UOCRA9TVsSAnZWagAA1vwQAJBWGYaK4KzMp2u3onOv\nCJux8lwJEm+PKi7mebRVoKNjFgmMPeBBdaPuxa1wRiYyYH1NVN7y/XD92QLC\nVhlKrv2F4U5VEvu1b1/P1deOe8vFFOkxgkJmxyzAaV/8tTItTiPWHxRuiwGm\nuMresbYbZLH5SUVUTYYAD1ofJAsb+gX3XYVtTz/6jAlSviFGR0oA1tFaKI05\nHRDGoH/cIq4gn6G1x3iL15WQhF1pv8A+9SpVuWFHhAiRLLUDu+QdMiZID4vB\nC0WauulEeqYI1ZsnU+J4+41Ry7zUZ50X0O/tA4hnyAs1A6zEyQGnUSNvUYBJ\nhtMiTGtj7nphkPdFem8dnvRctLEse43JmiKXYEoSYzT0MDjAX52R7e9KC8BF\nliJ+zdoDDnGE5AG10SJRLSe5WIIZ4hH4K9tBZYXQev/fGmqaArMj6jrQgtvm\nju/VBo8Q4utKl9Kpu0Js+xxaPhTvl8jWyTMR0Kbe7ehexQP7Jo7DKCbJfAxe\n5OlzKRtYuw+AsRF/oAknlRNtvi+xc+bnQDnLCELaIPrx/ZSR6G72MKbDMxRg\nJEujF6RSsxnzsCsIuNtslrugl/9p6JWhvHdqvR6sCxWZmtrmh4JMAla57ISH\ng7Q5IVkrJaCNRx+YNNzMZjEux6e7sOMM1iaPi/ojxVaYbTmhtDEU6yXZPdrC\ngr5u\r\n=zObO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFNYwrLbgazCh/Ke8l5HQGk7t3yzN5M2IEACf9+LQWFBAiAhKKrUOQ+M3bAv09GrEMql7W3dXyN9w9nY2nAzDT0Itw=="}],"size":4223,"noattachment":false,"key":"/jest-specific-snapshot/-/jest-specific-snapshot-4.0.0.tgz"},"maintainers":[{"name":"igor-dv","email":"davydkin.igor@gmail.com"}],"_npmUser":{"name":"igor-dv","email":"davydkin.igor@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-specific-snapshot_4.0.0_1597220109639_0.39645637262297084"},"_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":1597220109821,"_cnpm_publish_time":1597220109821,"dist-tags":{"latest":"8.0.0"}}