{"name":"jest-specific-snapshot","version":"7.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":"^29.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":"^29.3.1","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":"^29.3.1","prettier":"^1.19.1"},"peerDependencies":{"jest":">= 29.0.0"},"gitHead":"fe8545f157687b6ee1bf245579de9829977c1c15","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@7.0.0","_nodeVersion":"16.11.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-Ut2YItOYFC88Pir/JPN8Cgjvf60N4ZPmIqGJ2iZI+c9SLR27hwJxaEngKpW4RurPb+p45BbSuZoKe9SlVIylQA==","shasum":"c8851bc263b780c0fa750462f61bd98fe956fc64","tarball":"http://registry-npm.ywwl.com/jest-specific-snapshot/download/jest-specific-snapshot-7.0.0.tgz","fileCount":10,"unpackedSize":9923,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE370F96x0buM1THbSo130qba8laqUL4Ky8a4QIvnfYFAiB9JUeu2kWGjBw94I9mjN8/esGL2oUcImt5hRh0FvZrcA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfg/iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgOw//cfqqcc4S4f0mtiCxoeUhxKUgMKwAjQ4R4/sVAw4XOUtOE8vh\r\nBqkOycD+Txwo4vd3U6LmwMqcOcmMQ94kve8pd5VMRAQRIscGfZ7/kBvnIrHd\r\n2vXAostGJIMfFfY2rVarckP07fVXLb8AMU3wYSayGwSS3msHfmfr46HD7aK0\r\nsBWwdvv6ln0MjGuhw7JOQyL1BIoEQDWamEwpeRjRC5Bq6Ua8TJAC1vWc8wsK\r\nIl7KKCqC/J9qqHXX/7ywJlLWa/IZ6vKb7MiQDSwEZnyC64j3o7LCheXpwTbX\r\neDmbKntVjy0LnPkaWKZw0f5LELPkr3zh+5waTzRDfyFxBIIoMeEPuCh2TuZj\r\nnF3eWGUV6tNnDuG/QITSv2D3fMtvfz1Jad5uz1EpaLK1mumY3cuNyzNBep62\r\nFRYL+Pjl3qnW6K+nykczSdVEpBd5Qb4NPypEYXRdMS48MrU/bHF6c8fuGfPj\r\nMPvt4o47C4s6fKyHmDDvxWX+6HPwARHlKIDJc0qxWQEjlDthLwL7lWFadzZo\r\nc8czOMD9pv/Pc80kQP3PjlPgEXu1Jx+PT1P0jRrSYlOde5OfdyQ9EtoZSgBW\r\nIpCAzH/RPIe/WZf+uuYo/yxcBS602fztDN3/Q8b9Tf2qlFE9em3smeqsgDsv\r\nh4nYj+iKJ4yk7Ws4DNwb4jgXeAGR77b6W1Y=\r\n=8RbR\r\n-----END PGP SIGNATURE-----\r\n","size":4176,"noattachment":false,"key":"/jest-specific-snapshot/-/jest-specific-snapshot-7.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_7.0.0_1669205985839_0.34953743695749995"},"_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":1669205986058,"_cnpm_publish_time":1669205986058,"dist-tags":{"latest":"8.0.0"}}