{"_id":"@dabapps/jest-matcher-react-shallow-snapshot","_rev":"3-b1b45bd657011b26e5f4990b149c1166","name":"@dabapps/jest-matcher-react-shallow-snapshot","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@dabapps/jest-matcher-react-shallow-snapshot","version":"1.0.0","description":"A jest matcher for shallow rendered React component snapshots","main":"dist/index.js","types":"src/typings.d.ts","scripts":{"dist":"./scripts/dist","prettier-check":"prettier --check '**/*.{ts,tsx,js,jsx}'","prettier":"prettier --write '**/*.{ts,tsx,js,jsx}'","lint":"npm run prettier-check && tslint --project tsconfig.json '{src,tests}/**/*.{ts,tsx}' -e '**/*.d.ts'","typecheck":"tsc --project tsconfig.json --noEmit","tests":"jest","test":"npm run lint && npm run typecheck && npm run tests -- --runInBand --coverage","prepublishOnly":"npm run dist"},"repository":{"type":"git","url":"git+https://github.com/dabapps/jest-matcher-react-shallow-snapshot.git"},"keywords":["react","shallow","test","renderer","snapshot"],"author":{"name":"Jake 'Sid' Smith"},"license":"MIT","bugs":{"url":"https://github.com/dabapps/jest-matcher-react-shallow-snapshot/issues"},"homepage":"https://github.com/dabapps/jest-matcher-react-shallow-snapshot#readme","dependencies":{"@dabapps/react-shallow-renderer":"^1.0.0","@types/jest":">=24","@types/react":">=16","@types/react-dom":">=16","jest":">=24","react":">=16","react-dom":">=16"},"devDependencies":{"prettier":"^1.16.4","ts-jest":"^24.0.0","tslint":"^5.13.1","tslint-config-dabapps":"github:dabapps/tslint-config-dabapps#v0.5.3","typescript":"^3.3.3333"},"peerDependencies":{"jest":">=24","react":">=16","react-dom":">=16"},"gitHead":"d1739d198fa09fb360da1a3bde5ef7f46234ff39","_id":"@dabapps/jest-matcher-react-shallow-snapshot@1.0.0","_nodeVersion":"10.5.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-5lBnNyTMY20c2tCcRDLyLXA7BbLX7lh9EcSOvIXhIxa4TlD1oIWskJWgdprqx677wImCUZVWNF12zHRRsRtwJw==","shasum":"fad24022e0fd11f8e5955c431393a9555cae9cfd","tarball":"https://registry.npmjs.org/@dabapps/jest-matcher-react-shallow-snapshot/-/jest-matcher-react-shallow-snapshot-1.0.0.tgz","fileCount":30,"unpackedSize":49251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJck2JLCRA9TVsSAnZWagAAX8YP/RageskQBGcVoVaVFlbK\nWlPeOGm570M8meyeotY9kf5OPkD0xOYyLJXWzGhmEpcnWfeeCTUJJcXKgTZ5\nwoI6/e0AO/gxwgi9oZNP6+i5p2cj10X+zBvC3XiwOgw9U3kMQYQYgfZsZClJ\naR5ZlKdb4lZaOzNbjrCZF63D/vOW6gUpFgldHoXzKkYbCM9nsxMK01dYaITK\nvLVucHoQQLa5GxBCh4rkzzEjMWx/BOA1EDVT2GATSueNEBDKTuyOphEV8bY5\nfTJIoEQP1yn2zLbPZ5tb5u1Wtgv22mnTVizxBp2TjOudzwdyMVl90r2txIIC\n+eaMCkHDfDx14VfrLnkq1tOdVk/249OW4q1ZRYB7RajrUvoFcKcZ4jWHs/A8\na8tiFV0wzGk0Nq/TEBbhdujh2mVzKB3C1t0EfLNptrgB16fKEKSqWELTKlBF\nQ+LQXZzBl3qAc2mN8wK49A0L1Fx5sVb2q5D1Xb52ZOr8asCAt9o9a4LHRPGN\nEpLo3JMww9dg1OykTcYTb7msEr2+aojAmuyjx0J5+IBnQVNVAiHjstdWr7j6\n6K7WbL5RnOr6hxEt4+qB/5gRAN/cR0csfIDFKBQ6gs9FB6AIlrxKJkykYRu4\nOh1Il8PNHJvQEKCBbIaYC/vevFbNicDRM3X3NxVyF7RMs94UesqMqKFNtqjb\nZlRw\r\n=g1ob\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDP32wXlzNDGIMv1d4g+o3CjG3sGdWZ2cWUHYaDBGL+hAiBIt9pp7Upt/rD+YwC+N6VjCFu10R8fxPfmurf/UwICrA=="}]},"maintainers":[{"name":"dabapps","email":"npm@dabapps.com"}],"_npmUser":{"name":"dabapps","email":"npm@dabapps.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-matcher-react-shallow-snapshot_1.0.0_1553162827183_0.19885750652792566"},"_hasShrinkwrap":false},"1.0.1":{"name":"@dabapps/jest-matcher-react-shallow-snapshot","version":"1.0.1","description":"A jest matcher for shallow rendered React component snapshots","main":"dist/index.js","types":"src/typings.d.ts","scripts":{"dist":"./scripts/dist","prettier-check":"prettier --check '**/*.{ts,tsx,js,jsx}'","prettier":"prettier --write '**/*.{ts,tsx,js,jsx}'","lint":"npm run prettier-check && tslint --project tsconfig.json '{src,tests}/**/*.{ts,tsx}' -e '**/*.d.ts'","typecheck":"tsc --project tsconfig.json --noEmit","tests":"jest","test":"npm run lint && npm run typecheck && npm run tests -- --runInBand --coverage","prepublishOnly":"npm run dist"},"repository":{"type":"git","url":"git+https://github.com/dabapps/jest-matcher-react-shallow-snapshot.git"},"keywords":["react","shallow","test","renderer","snapshot"],"author":{"name":"Jake 'Sid' Smith"},"license":"MIT","bugs":{"url":"https://github.com/dabapps/jest-matcher-react-shallow-snapshot/issues"},"homepage":"https://github.com/dabapps/jest-matcher-react-shallow-snapshot#readme","dependencies":{"@dabapps/react-shallow-renderer":"^1.0.0","@types/jest":">=24","@types/react":">=16","@types/react-dom":">=16","jest":">=24","react":">=16","react-dom":">=16"},"devDependencies":{"prettier":"^1.16.4","ts-jest":"^24.0.0","tslint":"^5.13.1","tslint-config-dabapps":"github:dabapps/tslint-config-dabapps#v0.5.3","typescript":"^3.3.3333"},"peerDependencies":{"jest":">=24","react":">=16","react-dom":">=16"},"gitHead":"d4494b74dbbbebd99d3d920be29900f4f952f068","_id":"@dabapps/jest-matcher-react-shallow-snapshot@1.0.1","_nodeVersion":"10.5.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-vYgOl4Ig3u6h0f8lNjxAVot3Xit5cyCy9NsAvMxCEygHZXBZBIvI+y9tDnX2EJXIYRmXgOMH5YQUn/6M74PM+Q==","shasum":"54229b42db944759a98e99cc05dedee961c780ef","tarball":"https://registry.npmjs.org/@dabapps/jest-matcher-react-shallow-snapshot/-/jest-matcher-react-shallow-snapshot-1.0.1.tgz","fileCount":30,"unpackedSize":49251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJco3/CCRA9TVsSAnZWagAAyhAP/26eFXlFcAlpiy8tA4WQ\n8r4nhMb6pUyakDEWCOJfXIb1f/jpKQi9nskGIa26TydK+nZCyceP4TPZWRWW\ny0x3qcTQWmwo1bVmf44gZmCp8jVCB3y/2mSK3DjWiRr+PSmtRo+q+F0Qtydd\n8/OgfsSf8fU+G3vQKYGVgvfDjyG5gU3aTUxEk5e1Gc7WtEy6scSls0BiD9kk\ncEGq7uamB1yHyjvYFLNIdThym1DzEa2iSSMbPuttK4BF0bZlLPoZDfnG3ghV\ntoHegNdr1DGiQKZ2gML0Qoanif00pYczfujkrIh2WOhrAW7dDZPRmSNRKP99\nmKbyH9FphpphZDp7D0FfiG4WjHnJ5TwQ+TA4S7ZRRMdNfTzgGjem85oqmYNF\nPs0ARFMm2z7NdUVv/8Fy/Uy0k597ChEvoMHf2pA5vOB/muWrvd/7LHiMLakR\nDsVXK8v/aWxqfN7AXATAcCsseCQGJh90PtDrgyMhTBmMdBOtvsO7YMGatiEK\npj4mvzV7aBoyr9z5ShEbiP9UulLNwkLvHLVqGIrKRRXAXBKpzS75Y6N9zIX7\n1v166RCIJOVjtwaT+Z+TAVv1YxjbZvWUQYAKAR7Tj5pzjyqUqriLOaDJDU/V\n5dFqJuyiYY8x+/adJvTEgAe3WLp4qSLd1u366xuCOukfkRXctSD5pzsFI+ED\nYG55\r\n=63io\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBroHmSQAaeySd6tiUbhY/HvEPA2SARzsuSDAiaLLJE2AiAqD6YGHalb7WH2RUQk4zpoa0ibxZQ1ZWwCzryZYWa+wA=="}]},"maintainers":[{"name":"dabapps","email":"npm@dabapps.com"}],"_npmUser":{"name":"dabapps","email":"npm@dabapps.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-matcher-react-shallow-snapshot_1.0.1_1554218945117_0.7497193680250787"},"_hasShrinkwrap":false},"2.0.0":{"name":"@dabapps/jest-matcher-react-shallow-snapshot","version":"2.0.0","description":"A jest matcher for shallow rendered React component snapshots","main":"dist/index.js","types":"src/typings.d.ts","scripts":{"dist":"rm -rf dist && tsc --project tsconfig.dist.json","prettier-check":"prettier --check '**/*.{ts,tsx,js,jsx}'","prettier":"prettier --write '**/*.{ts,tsx,js,jsx}'","lint":"npm run prettier-check && tslint --project tsconfig.json '{src,tests}/**/*.{ts,tsx}' -e '**/*.d.ts'","typecheck":"tsc --project tsconfig.json --noEmit","tests":"jest","test":"npm run lint && npm run typecheck && npm run tests -- --runInBand --coverage","prepublishOnly":"npm run dist"},"repository":{"type":"git","url":"git+https://github.com/dabapps/jest-matcher-react-shallow-snapshot.git"},"keywords":["react","shallow","test","renderer","snapshot"],"author":{"name":"Jake 'Sid' Smith"},"license":"MIT","bugs":{"url":"https://github.com/dabapps/jest-matcher-react-shallow-snapshot/issues"},"homepage":"https://github.com/dabapps/jest-matcher-react-shallow-snapshot#readme","dependencies":{"@dabapps/react-shallow-renderer":"^2.0.0","@types/jest":">=24","@types/react":">=16","@types/react-dom":">=16","jest":">=24","react":">=16","react-dom":">=16"},"devDependencies":{"prettier":"^1.16.4","ts-jest":"^24.0.0","tslint":"^5.20.1","tslint-config-dabapps":"^0.6.2","typescript":"^3.3.3333"},"peerDependencies":{"jest":">=24","react":">=16","react-dom":">=16"},"gitHead":"bccc536e6aac73bb03e678c24516e7d96c6a6467","_id":"@dabapps/jest-matcher-react-shallow-snapshot@2.0.0","_nodeVersion":"10.5.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-gGhXU8/SngPNX8Tc7G1vBULNDwGBfY+1k6bU/8kfTKKvy47bTi1ilN0CGbwphBJeZVe+tK5VBFMU/VCNo9QlgQ==","shasum":"7957b4da242d3406c508eeb0817380f99768b430","tarball":"https://registry.npmjs.org/@dabapps/jest-matcher-react-shallow-snapshot/-/jest-matcher-react-shallow-snapshot-2.0.0.tgz","fileCount":18,"unpackedSize":10013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLtGWCRA9TVsSAnZWagAA7YwP/iTLkjP/ZhJWMP+dW2yP\nALQa1V1KujnIeW+oRf4s0QUxyT2tiBMwXWlC5t8SwNo+gaiAdviQEIocKaFe\njH4StmOWJvYNEF5gGy12bgjARkYFRDvWk6L7eMqgeO1kkSOoMmEF26gbmirP\nNjJ+l7wmOEjkO+bBMqCny0OLrfJuHvJo/3B0TotVdYhdaqEif+OP8IcOcO0p\nlBxky4yvpZHNH3scm7X016xi3WxCJe+AVJYmWfeaWPakh8Ioa89zirmVp4Cm\nhfLKpnOlFOyL3gAfZ37/tR4v8merESsQQvbMmb3PKS7W0AqcYCxcS9wDMAcW\nHyfM+e9pejw0wrbNZpO+rnriLQjNXXAY/MLZsEwBc1d3NKSPOm0PsyGJ+mWQ\nNlPehSK8YcQd9Ca9aBkC/GbVRLfq5IhRnNGVh1diPQ/EaZ2hHJg+Wf71GllG\nQHlavLUoXDy7EhvkLepj7GXSgz71JXkaArQrLtCby7CRwyO154s8xY3Vg6NH\naIYdGGhD9Ki1p1A6r8BRIT1SK1i5BUeUACMEhaYTmXHKNEAxHwf1zXjViPMX\nh/Hx8XdR5ZhToA5yZIIfCTDvHG5FpMPtRUasjrlZtgmlm9wPvjzsTZlldHe2\npcP8d5OzHbFgDJ4P4t/nI0tSsJeLKAPLkqTWHDQLmsrK4SstihKkGixt7Rfu\nZA3h\r\n=WQ8c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBaZkvulcsjjr0eAbtAfauku7BcrXPoiVqE5d838l42fAiB22lhpwKCcL2+PsmHkjpIkH238iws2E0l5MrJjFxKnkA=="}]},"maintainers":[{"name":"dabapps","email":"npm@dabapps.com"}],"_npmUser":{"name":"dabapps","email":"npm@dabapps.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-matcher-react-shallow-snapshot_2.0.0_1580126614397_0.7080597907817066"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-21T10:07:06.995Z","1.0.0":"2019-03-21T10:07:07.317Z","modified":"2022-04-05T02:31:38.942Z","1.0.1":"2019-04-02T15:29:05.237Z","2.0.0":"2020-01-27T12:03:34.514Z"},"maintainers":[{"name":"dabapps","email":"npm@dabapps.com"}],"description":"A jest matcher for shallow rendered React component snapshots","homepage":"https://github.com/dabapps/jest-matcher-react-shallow-snapshot#readme","keywords":["react","shallow","test","renderer","snapshot"],"repository":{"type":"git","url":"git+https://github.com/dabapps/jest-matcher-react-shallow-snapshot.git"},"author":{"name":"Jake 'Sid' Smith"},"bugs":{"url":"https://github.com/dabapps/jest-matcher-react-shallow-snapshot/issues"},"license":"MIT","readme":"# jest-matcher-react-shallow-snapshot\n\n**A jest matcher for shallow rendered React component snapshots**\n\n## About\n\nThis is a fork of [@jakesidsmith/jest-matcher-react-shallow-snapshot](https://github.com/jakesidsmith/jest-matcher-react-shallow-snapshot).\n\nThis is a jest matcher that allows you to easily create shallow snapshots of React components will full support for:\n\n* React.memo\n* React.forwardRef\n* React.Fragment\n* React.createContext (Provider and Consumer)\n* ReactDOM.createPortal\n* Functional components\n* Component classes\n\nThe output of this matcher is far more informative than other existing solutions, providing context of memo wrapped components, fragments, etc, and does not require importing a renderer for each of your test files.\n\nThis relies on [react-shallow-renderer](https://www.npmjs.com/package/@dabapps/react-shallow-renderer) under the hood, which you could use without the jest matcher if you prefer / are using another test suite.\n\nCheck out the [react-shallow-renderer](https://www.npmjs.com/package/@dabapps/react-shallow-renderer) readme for some examples of the snapshot output.\n\n## Example\n\n```jsx\nexpect(<MyComponent />).toMatchReactShallowSnapshot();\n```\n\n## Install\n\nInstall as a dev dependency (`-D` is short for `--save-dev`)\n\n```shell\nnpm i @dabapps/jest-matcher-react-shallow-snapshot -D\n```\n\n## Configuration\n\n### Jest config\n\nThis library requires you to define a `setupFilesAfterEnv` entry in your jest config (or `setupTestFrameworkScriptFile` for older versions of jest).\n\nThis should point to a file which will be used to initialize custom matchers:\n\n```js\nmodule.exports = {\n  setupFilesAfterEnv: [\n    '<rootDir>/path/to/custom-matchers.js'\n  ]\n};\n```\n\nIf you don't already have a such a file you should create one, and then simply import this library in that file:\n\n```js\nimport '@dabapps/jest-matcher-react-shallow-snapshot';\n```\n\nIf you are using TypeScript, importing this file from your setup file should apply the types needed to call `.toMatchReactShallowSnapshot`. If it doesn't, then make sure that the setup file is included in your tsconfig.\n\n## Usage\n\nNow you can simply render a react component and expect it to match your shallow snapshot:\n\n```jsx\nexpect(<MyComponent />).toMatchReactShallowSnapshot();\n```\n\n## Updating this fork from upstream\n\nEnsure you have added a remote upstream in git e.g.\n\n```shell\ngit remote add upstream git@github.com:JakeSidSmith/jest-matcher-react-shallow-snapshot.git\n```\n\nCreate a new branch (from master) and run the following to pull changes from [upstream](https://github.com/jakesidsmith/jest-matcher-react-shallow-snapshot):\n\n```shell\ngit fetch upstream\ngit pull upstream master\n```\n","readmeFilename":"README.md"}