Expect, a core assertion library used extensively within the Jest testing framework, has seen a notable version update from 27.5.1 to 28.0.0. Both versions share the same fundamental goal: providing the expect function for writing expressive and readable tests, as documented on the Jest website. However, several key differences emerge upon closer inspection, potentially impacting developers.
Version 28.0.0 includes @jest/expect-utils as a dependency. A potentially interesting addition is the change of the scope of the dependency @jest/types to @jest/expect-utils. Both versions depend on core utilities like jest-get-type, jest-message-util, and jest-matcher-utils, but the version numbers of these dependencies have been bumped to from 27.5.1 to 28.0.0,suggesting internal updates and improvements within those modules. Several dev dependencies are bumped from 27.5.1 to 28.0.0 (like @jest/test-utils), or they are using newer versions (@tsd/typescript is "~4.6.2" on version 28 vs "~4.1.5" on version 27.5.1).
Thedist metadata also reveals that version 28.0.0 has a smaller unpacked size (142698 bytes) and fewer files (13) compared to version 27.5.1 (172096 bytes and 25 files). This suggests a possible optimization in the package structure and potentially faster installation times. Furthermore, developers should note the release date difference, with version 28.0.0 released on April 25, 2022, and version 27.5.1 released earlier on February 8, 2022. This time difference implies cumulative bug fixes and enhancements in the newer version.
For developers, upgrading to version 28.0.0 offers potential benefits like optimized package size, inclusion of @jest/expect-utils, and the latest improvements within its core dependencies, contributing to a more efficient and reliable testing experience. As always, thorough testing of your test suites after upgrading expect is recommended to ensure compatibility and identify potential breaking changes, even though the library strives for API stability.
The are not vulnerabilities for the version 28.0.0 of the package expect