react-test-renderer
Advanced tools
Comparing version 0.0.0-experimental-2e470a788-20240214 to 0.0.0-experimental-2ec26bc4-20241111
'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-2e470a788-20240214", | ||
"version": "0.0.0-experimental-2ec26bc4-20241111", | ||
"description": "React package for snapshot testing.", | ||
@@ -20,10 +20,9 @@ "main": "index.js", | ||
}, | ||
"homepage": "https://reactjs.org/", | ||
"homepage": "https://react.dev/", | ||
"dependencies": { | ||
"react-is": "0.0.0-experimental-2e470a788-20240214", | ||
"react-shallow-renderer": "^16.15.0", | ||
"scheduler": "0.0.0-experimental-2e470a788-20240214" | ||
"react-is": "0.0.0-experimental-2ec26bc4-20241111", | ||
"scheduler": "0.0.0-experimental-2ec26bc4-20241111" | ||
}, | ||
"peerDependencies": { | ||
"react": "0.0.0-experimental-2e470a788-20240214" | ||
"react": "0.0.0-experimental-2ec26bc4-20241111" | ||
}, | ||
@@ -35,5 +34,4 @@ "files": [ | ||
"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 too big to display
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
858442
7
23567
+ Addedreact@0.0.0-experimental-2ec26bc4-20241111(transitive)
+ Addedreact-is@0.0.0-experimental-2ec26bc4-20241111(transitive)
+ Addedscheduler@0.0.0-experimental-2ec26bc4-20241111(transitive)
- Removedreact-shallow-renderer@^16.15.0
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedreact@0.0.0-experimental-2e470a788-2024021418.3.1(transitive)
- Removedreact-is@0.0.0-experimental-2e470a788-2024021418.3.1(transitive)
- Removedreact-shallow-renderer@16.15.0(transitive)
- Removedscheduler@0.0.0-experimental-2e470a788-20240214(transitive)