{"name":"jest-specific-snapshot","version":"6.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":"^28.0.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":"^28.1.3","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":"^28.1.3","prettier":"^1.19.1"},"peerDependencies":{"jest":">= 28.0.0"},"gitHead":"b9cadec7f64150e17939d6c0e677bf992fcc1cd3","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@6.0.0","_nodeVersion":"16.11.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-IiAfq0bmuXNwRkfCO3mLTCMhZJBdU05y/zEUKRk0KDhW6WQ7ZL0xTgjjtMrfLb0h+o/i+1/N68Ls3NrIFTykiA==","shasum":"8373589825234fbbeef1bf054f5a6720a15a54f3","tarball":"http://registry-npm.ywwl.com/jest-specific-snapshot/download/jest-specific-snapshot-6.0.0.tgz","fileCount":10,"unpackedSize":9923,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADw53rx3tBlYS6zaYoUj22BkNelbo3GZMIx38ck7LBJAiBGL0yDrFf3tmwyIROs5zXob1k9FjT0sNZiz7yQsJ7F/g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdKcGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6Lg//WQJjFyyW5vG1subiuC9qd3bxeUG0wuGc1DNtYMsQ39EeY+5a\r\nfN6OtY3t7wgVglo7F6US7gdcm/+s1ADfaQltxvYdFikW6l4nMS8xtZ8h+g+z\r\nvRomjySwA5zp/D6queA/FZhAWpKvERTEUcXa25IGK0T8SsNapYIA+xafBIqi\r\n7QvQuSOD1iQwGnlX594THCnSBYbL4Gjs0M62xetr7O6w6DakRksJRSXfeaj4\r\nnD2nmYoMPJSjDJvWvUo8mtEz0STmxH162YzEEfiuDkx3vvGc51irlzI5tcNK\r\nM0dD7XauNFFrb36IZvVvVDWgGrJe6zAsa2PIxX2ohpMXtYKAV7MvyP6In0G/\r\n5JEvnaCBf5O18wUxJ3DNb1LaSrY8Bibp6WZ7g2MEUmXFM9ouqKawySZFAyRu\r\ndbN6XnW3vDp1mA0SPKKRl+ytvlwIWJk0WBC7NpYsgJ0VmVcsE7iyZZK5B11S\r\n/NlOL0NxFz+VIJ2jsqiOb5dYo2vMRZ2wlqDA0NmW+MoxwvRYIIz6PawvxE95\r\nZWdwRMMYmVBvVfv5CEWXU72cbuwxR1/7q3PvRtQqmofRBtJXBydnJExXlm4b\r\nNPPo3Y3nxSZ6CeoD2v4ocW3iJZIrpdH0JJG7yImb8A9tMjUPx9AHDLL9GaE8\r\no5qASg1Ko4zGFfwV8WDGuGzo1KBxukWulb0=\r\n=7Blf\r\n-----END PGP SIGNATURE-----\r\n","size":4174,"noattachment":false,"key":"/jest-specific-snapshot/-/jest-specific-snapshot-6.0.0.tgz"},"_npmUser":{"name":"igor-dv","email":"davydkin.igor@gmail.com"},"directories":{},"maintainers":[{"name":"igor-dv","email":"davydkin.igor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-specific-snapshot_6.0.0_1668589318025_0.693279913452574"},"_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":1668589318192,"_cnpm_publish_time":1668589318192,"dist-tags":{"latest":"8.0.0"}}