{"name":"react-test-renderer","version":"19.0.0-rc-1df34bdf62-20240605","keywords":["react","react-native","react-testing"],"license":"MIT","_id":"react-test-renderer@19.0.0-rc-1df34bdf62-20240605","maintainers":[{"name":"zpao","email":"paul@oshannessy.com"},{"name":"gnoff","email":"jcs.gnoff@gmail.com"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"sophiebits","email":"npm@sophiebits.com"},{"name":"react-bot","email":"react-core@meta.com"}],"homepage":"https://react.dev/","bugs":{"url":"https://github.com/facebook/react/issues"},"dist":{"shasum":"2038b9423010478ff3c6a932ca9c84c75e2f45b6","tarball":"http://registry-npm.ywwl.com/react-test-renderer/download/react-test-renderer-19.0.0-rc-1df34bdf62-20240605.tgz","fileCount":7,"integrity":"sha512-ALF0cQYdBuh/gLUcMC9JgIQaanQCpVqrhaAsRfnD9ncFFs0kDUxx9AtGlzxxjihXs5EMRvJuEtr10lwM7O4iTg==","signatures":[{"sig":"MEQCIHHuKj20tiGvFwfeUKDFrYyVQkwEhk9pFP6hdWiLc5LRAiBSrDl/q9S7oqsqOVRNC+K85RVaM7Po1eZwA6Jug13Bfw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1120658,"size":233888,"noattachment":false,"key":"/react-test-renderer/-/react-test-renderer-19.0.0-rc-1df34bdf62-20240605.tgz"},"main":"index.js","readme":"# `react-test-renderer` (DEPRECATED)\n\n## Deprecation notice\n\n`react-test-renderer` is deprecated and no longer maintained. It will be removed in a future version. As of React 19, you will see a console warning when invoking `ReactTestRenderer.create()`.\n\n### React Testing\n\nThis library creates a contrived environment and its APIs encourage introspection on React's internals, which may change without notice causing broken tests. It is instead recommended to use browser-based environments such as jsdom and standard DOM APIs for your assertions.\n\nThe React team recommends [`@testing-library/react`](https://testing-library.com/docs/react-testing-library/intro) as a modern alternative that uses standard APIs, avoids internals, and [promotes best practices](https://testing-library.com/docs/guiding-principles).\n\n### React Native Testing\n\nThe React team recommends @testing-library/react-native as a replacement for `react-test-renderer` for native integration tests. This React Native testing-library variant follows the same API design as described above and promotes better testing patterns.\n\n## Documentation\n\nThis package provides an experimental React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM or a native mobile environment.\n\nEssentially, this package makes it easy to grab a snapshot of the \"DOM tree\" rendered by a React DOM or React Native component without using a browser or jsdom.\n\nDocumentation: [https://reactjs.org/docs/test-renderer.html](https://reactjs.org/docs/test-renderer.html)\n\nUsage:\n\n```jsx\nconst ReactTestRenderer = require('react-test-renderer');\n\nconst renderer = ReactTestRenderer.create(\n  <Link page=\"https://www.facebook.com/\">Facebook</Link>\n);\n\nconsole.log(renderer.toJSON());\n// { type: 'a',\n//   props: { href: 'https://www.facebook.com/' },\n//   children: [ 'Facebook' ] }\n```\n\nYou can also use Jest's snapshot testing feature to automatically save a copy of the JSON tree to a file and check in your tests that it hasn't changed: https://jestjs.io/blog/2016/07/27/jest-14.html.\n","gitHead":"1df34bdf626af3e4566364dcdf7f1c387d2f4252","_npmUser":{"name":"react-bot","email":"react-core@meta.com"},"repository":{"url":"git+https://github.com/facebook/react.git","type":"git","directory":"packages/react-test-renderer"},"_npmVersion":"10.5.0","description":"React package for snapshot testing.","directories":{},"_nodeVersion":"18.20.1","dependencies":{"react-is":"19.0.0-rc-1df34bdf62-20240605","scheduler":"0.25.0-rc-1df34bdf62-20240605"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"react":"19.0.0-rc-1df34bdf62-20240605"},"_npmOperationalInternal":{"tmp":"tmp/react-test-renderer_19.0.0-rc-1df34bdf62-20240605_1717574274131_0.2826555097660379","host":"s3://npm-registry-packages"},"publish_time":1717574274439,"_cnpm_publish_time":1717574274439,"dist-tags":{"backport":"19.1.10","beta":"19.0.0-beta-26f2496093-20240514","canary":"19.3.0-canary-df6aa4ec-20261112","experimental":"0.0.0-experimental-df6aa4ec-20261112","latest":"19.3.1","next":"19.3.0-canary-d5736f09-20260507","rc":"19.0.0-rc.1"}}