react-test-renderer
Advanced tools
Comparing version 0.0.0-experimental-76f85b3e5 to 0.0.0-experimental-7771d3a7-20240827
'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-test-renderer.production.min.js'); | ||
module.exports = require('./cjs/react-test-renderer.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-test-renderer.development.js'); | ||
} |
{ | ||
"name": "react-test-renderer", | ||
"version": "0.0.0-experimental-76f85b3e5", | ||
"version": "0.0.0-experimental-7771d3a7-20240827", | ||
"description": "React package for snapshot testing.", | ||
@@ -20,11 +20,9 @@ "main": "index.js", | ||
}, | ||
"homepage": "https://reactjs.org/", | ||
"homepage": "https://react.dev/", | ||
"dependencies": { | ||
"object-assign": "^4.1.1", | ||
"react-is": "0.0.0-experimental-76f85b3e5", | ||
"react-shallow-renderer": "^16.13.1", | ||
"scheduler": "0.0.0-experimental-76f85b3e5" | ||
"react-is": "0.0.0-experimental-7771d3a7-20240827", | ||
"scheduler": "0.0.0-experimental-7771d3a7-20240827" | ||
}, | ||
"peerDependencies": { | ||
"react": "0.0.0-experimental-76f85b3e5" | ||
"react": "0.0.0-experimental-7771d3a7-20240827" | ||
}, | ||
@@ -34,8 +32,6 @@ "files": [ | ||
"README.md", | ||
"build-info.json", | ||
"index.js", | ||
"shallow.js", | ||
"cjs/", | ||
"umd/" | ||
"cjs/" | ||
] | ||
} |
@@ -1,3 +0,19 @@ | ||
# `react-test-renderer` | ||
# `react-test-renderer` (DEPRECATED) | ||
## Deprecation notice | ||
`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()`. | ||
### React Testing | ||
This 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. | ||
The 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). | ||
### React Native Testing | ||
The 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. | ||
## Documentation | ||
This 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. | ||
@@ -7,6 +23,4 @@ | ||
Documentation: | ||
Documentation: [https://reactjs.org/docs/test-renderer.html](https://reactjs.org/docs/test-renderer.html) | ||
[https://reactjs.org/docs/test-renderer.html](https://reactjs.org/docs/test-renderer.html) | ||
Usage: | ||
@@ -13,0 +27,0 @@ |
'use strict'; | ||
module.exports = require('react-shallow-renderer'); | ||
function ReactShallowRenderer() { | ||
throw new Error( | ||
'react-test-renderer/shallow has been removed. See https://react.dev/warnings/react-test-renderer.' | ||
); | ||
} | ||
module.exports = ReactShallowRenderer; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3
41
852033
7
23410
+ Addedreact@0.0.0-experimental-7771d3a7-20240827(transitive)
+ Addedreact-is@0.0.0-experimental-7771d3a7-20240827(transitive)
+ Addedscheduler@0.0.0-experimental-7771d3a7-20240827(transitive)
- Removedobject-assign@^4.1.1
- Removedreact-shallow-renderer@^16.13.1
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedreact@0.0.0-experimental-76f85b3e518.3.1(transitive)
- Removedreact-is@0.0.0-experimental-76f85b3e518.3.1(transitive)
- Removedreact-shallow-renderer@16.15.0(transitive)
- Removedscheduler@0.0.0-experimental-76f85b3e5(transitive)