Enzyme-to-json is a valuable utility for React developers using Enzyme and Jest for testing, streamlining the creation of snapshot tests. Version 2.0.0 builds upon the solid foundation of version 1.6.0, offering subtle but important improvements to the developer experience. Both versions share core dependencies like lodash utilities (filter, isnil, isplainobject, omitby, range), object-values, and object.entries, ensuring consistent data manipulation and object handling.
The key differences lie primarily in the development dependencies. Version 2.0.0 transitions from specific Babel presets for ES2015 and React to the more encompassing babel-preset-env, alongside with "@babel/plugin-transform-object-rest-spread" which leads to a streamlined and future-proof Babel configuration. It has also a babel-plugin-transform-react-jsx which was not present in the v1.6.0. This shift simplifies the management of Babel presets and caters to a wider range of JavaScript environments. Another difference is that v1.6.0 uses lint-staged and pre-commit to keep the code clean while v2.0.0 doesnt.
Both versions support Enzyme version ^2.7.1 as a peer dependency ensuring compatibility with existing projects. For developers, upgrading to version 2.0.0 offers benefits such as improved Babel configuration as the babel-preset-env packages makes the code portable, but may require adjustments related to linting and pre-commit hooks if these aspects are important in the project. Overall, enzyme-to-json simplifies React component testing, and version 2.0.0 provides a smoother and simpler development setup for the projects.
The are not vulnerabilities for the version 2.0.0 of the package enzyme-to-json