{"name":"jest-specific-snapshot","version":"1.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","prepublish":"npm run babel"},"jest":{"cacheDirectory":"./.jest/cache"},"dependencies":{"jest-snapshot":">=20.0.3"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-jest":"^20.0.3","babel-preset-es2015":"^6.24.1","eslint":"^4.3.0","eslint-config-airbnb-base":"^11.2.0","eslint-config-prettier":"^2.3.0","eslint-plugin-import":"^2.7.0","eslint-plugin-jest":"^20.0.3","eslint-plugin-json":"^1.2.0","eslint-plugin-prettier":"^2.1.2","eslint-teamcity":"^1.4.0","jest":"^20.0.4","jest-cli":"^20.0.4","prettier":"^1.5.3"},"peerDependencies":{"jest":"*"},"gitHead":"6b70a33b1e225b220f8ebfa58523f1cb21115e7c","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@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"igor-dv","email":"davydkin.igor@gmail.com"},"dist":{"integrity":"sha512-EjCK8Ob8eneeQCdBuO06J1v1C1jklKK7VvCOG/iwQx+8byZ7iCY8+d9M7xlUJiu76ubycXtSkIrPrL+nqjJsjA==","shasum":"157c79e2534a6fea820fd475f5d17740c8f90833","tarball":"http://registry-npm.ywwl.com/jest-specific-snapshot/download/jest-specific-snapshot-1.0.0.tgz","fileCount":9,"unpackedSize":7972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHnMOCRA9TVsSAnZWagAA9okP/i94xk37x3h/16fjjkhm\n1MsspUQi0ejoJJMiB8LSUJVvdeu2w0fKzgsRq2xv5uDI2ouc1ZE4HX8Ifvy2\npG4rNpbFHJTnqBit/ZWmRPyz//rEy+IigU4DFmSf+3CuMlGAzCqMkON4vzI6\ng+XifItsID18vD9GuxNYV5DOX2IyIgEDsCWxVhlJ0Ao7uQ/2uWHqzf/6das4\n+7N8O8C4gDR9k1xK099WidWNPKV4+QRUzU7ZxU/n3W6f21yuPnuB6SSDIIaR\nWdaUK6cE7806Ly598mMbUd13NKZACZTVJ5F03is8ZsZYk6F/CmEejN5L5sCg\nG0sfNct/EcU+dIVahLKuANpQxkExJpXRjBR7GdttQzbt0cIoA9lom57mhZRu\ndEwy3LuRE9o6DQuEgnaAu5BUusqHURV6eGKqbP9ZATqLj7DeSiCiqMFEVTQ8\n45MqDeVpMhvnzetluLvnlvyZZHm3QKjljzzh/y+0bDQP3UuEvVMPEToJ0AJ7\nJlzj7nbLcM4vIzngMNDHWIJhvCB4PAV/4oJ2zbTn0GwZ3InFxjAI6HgFp6jp\n/hNDcQX8VCmm9rfou30qMb2f4dVkEvHRjcPzQO9rLHE1OCDOEtlQDSrWQwEJ\ncIOlBKYOULtbfQEpzrOsadzyTdvwbwj7T5fhHQX5DgRWWUuUz4g9Z6KvaVht\nmLB2\r\n=awvC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDbWeJZ19EHMX9u4QGuRHTs2tWuGyxqFNd7SLn2KnWvJAiByLPSwbxLqlBE9Vjouf1Aj+iUSzidBk+PS4MswwLTSew=="}],"size":3606,"noattachment":false,"key":"/jest-specific-snapshot/-/jest-specific-snapshot-1.0.0.tgz"},"maintainers":[{"name":"igor-dv","email":"davydkin.igor@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-specific-snapshot_1.0.0_1528722189628_0.2042779275714337"},"_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":1528722189718,"_cnpm_publish_time":1528722189718,"dist-tags":{"latest":"8.0.0"}}