{"name":"jest-specific-snapshot","version":"8.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/igor-dv/jest-specific-snapshot.git"},"main":"dist/index.js","scripts":{"test:default":"jest specific.snapshot.test","test:old":"jest specific.snapshot.old-format.test --config jest.old-format.config.js","test":"npm run test:default && npm run test:old","babel":"babel src -d dist","lint":"eslint .","lint-fix":"npm run lint -- --fix","prepare":"npm run babel"},"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":"106b40f0c2b2c4f0740c0138e3965a5eebaf9812","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@8.0.0","_nodeVersion":"16.11.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-PjK0cqPbN3ZGU1pdP78YBEFMsS1AsV28hIHg249E0v/bTtGAJqDm7lNDLj0Cs0O26P2sulbXbgEQU9xLm34WmA==","shasum":"c80af21dcd95b6c46b73f71618f887ef3825a44c","tarball":"http://registry-npm.ywwl.com/jest-specific-snapshot/download/jest-specific-snapshot-8.0.0.tgz","fileCount":12,"unpackedSize":9979,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdcNsJBIWQrvZjuYp3Za2RitG0ZgutzahCdsu3cbE1qwIgHJSvrqauHdmzAgYaNJa6xtW1eMMC8vUivRy8QUAeNt0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBH9RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVaQ/+InkmlMkV6Hfr0MX0RofO7wGElC1f7hA9gvrl5DnWigHYcv4M\r\noKhUhZcqyqI3b/Vk87xzIfzB5BefpYkvCfJxUIvJi4zobEGU3E6qc9ujrpiY\r\nh5i8G+fhsmkK0rRKartvK2HsTveKoODTJ/jv57lcoN2m7UO6jn5oBcoshU4A\r\nojGmxr0SJ0RYy6bO3dC+k5708VCGnGBTWfTV7mO9/j93jal+NXBUNAtJlQqw\r\nYCalKe5D3M34mku2Hi19zgAp22fEmz1B3LavPfTHemktjXx/ieFgdgrkGAFt\r\nPpgbJZ3gYJXV1ITHtZgoPB9CJqVH5utF6btVDskfxw2aZViCbSq3ZNb4v2y5\r\nKyh7mOpW2Y/+ZGH+PiIluUMocJgUVUh3hUtoJPN9CJ5Mp7eTzk5Ufn0mzyW3\r\n+I17e5ABaAmIagzcuor5FdQhmnXLMRCjgSeGHoFvVjDMlRIrO9An0BEqfNwf\r\nuS2wTKUGClsDDNems7jnhyEPVCDbI8FExx/Q+aklfCIpnVe0vyedrBjeeE05\r\ntchLBM2lPxMnuQblQ6wnT2eVV6K4c/AbaFECbRnUzZejYUAy4vQniB/wwGV9\r\neWsMmQYh8am4C4umz+f8hsD7JBoKftNv39Y5eLaQjsijw24ZmEIXdIxfpFEB\r\nEiRZICV6rV++yyxRMHfdgKl/F2sIA6co8q4=\r\n=csAU\r\n-----END PGP SIGNATURE-----\r\n","size":4276,"noattachment":false,"key":"/jest-specific-snapshot/-/jest-specific-snapshot-8.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_8.0.0_1678016337659_0.47639100587128036"},"_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":1678016337805,"_cnpm_publish_time":1678016337805,"dist-tags":{"latest":"8.0.0"}}