{"name":"react-test-renderer","version":"0.0.0-experimental-cc1ec60d0d-20240607","description":"React package for snapshot testing.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/facebook/react.git","directory":"packages/react-test-renderer"},"keywords":["react","react-native","react-testing"],"license":"MIT","bugs":{"url":"https://github.com/facebook/react/issues"},"homepage":"https://react.dev/","dependencies":{"react-is":"0.0.0-experimental-cc1ec60d0d-20240607","scheduler":"0.0.0-experimental-cc1ec60d0d-20240607"},"peerDependencies":{"react":"0.0.0-experimental-cc1ec60d0d-20240607"},"_id":"react-test-renderer@0.0.0-experimental-cc1ec60d0d-20240607","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","readmeFilename":"README.md","gitHead":"cc1ec60d0de3be60948fc152b2377a42504f551a","_nodeVersion":"18.20.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-f/egBuVSH18Dbc/E9TqZOgsEYRhH/ZEVOi3lNxTOmMMgkjW1D1pgjs9uU9p2lp2LA6kpsGOMNi1qkV46LRzGvA==","shasum":"e187bedb3b0632d08c69caf70a0103a0c06b9098","tarball":"http://registry-npm.ywwl.com/react-test-renderer/download/react-test-renderer-0.0.0-experimental-cc1ec60d0d-20240607.tgz","fileCount":7,"unpackedSize":1123079,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHD+0Ih6T8XVwVXyRM+pmnQTP+m4wA9sI8ObmWMviBAYAiBz6/1rdnuohfbH72Pqz/veuG1cRxbBWPXLqLWXAlwkvw=="}],"size":234313,"noattachment":false,"key":"/react-test-renderer/-/react-test-renderer-0.0.0-experimental-cc1ec60d0d-20240607.tgz"},"_npmUser":{"name":"react-bot","email":"react-core@meta.com"},"directories":{},"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"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-test-renderer_0.0.0-experimental-cc1ec60d0d-20240607_1717776983841_0.05284994755692929"},"_hasShrinkwrap":false,"publish_time":1717776984071,"_cnpm_publish_time":1717776984071,"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"}}