Migrating from v1.x to v2.0
Upgrading to Automock v2.0 brings a host of improvements designed to enhance your testing experience. This guide outlines the key changes and steps for a smooth migration.
What's New in v2.0​
Enhanced Developer Experience
- Improved error handling with more specific and informative error types for easier debugging.
- Enhanced JSDoc documentation for better API understanding.
Robustness and Flexibility
- Internal changes in
@automock/adapters.nestjs
,@automock/core
,@automock/common
, and@automock/types
to make the library more robust and flexible.
- Internal changes in
Native Test Doubles Support
- One of the notable updates is the transition to using native test doubles instead of the
jest-mock-extended
library. By leveraging native test doubles, Automock now provides better compatibility across different testing frameworks, making it easier to integrate and utilize its capabilities within your preferred testing ecosystem.
- One of the notable updates is the transition to using native test doubles instead of the
For a detailed list of changes, it's recommended reading Automock's 2.0 Release Notes.
Key Migration Steps​
Manual Installation of NestJS Adapter​
In v1.x, the NestJS adapter came bundled by default. In v2.0, you'll need to install it manually:
- npm
- Yarn
- pnpm
$ npm i -D @automock/adapters.nestjs
$ yarn add --dev @automock/adapters.nestjs
$ pnpm add -D @automock/adapters.nestjs
Wrapping Up​
The migration from v1.x to v2.0 is designed to make Automock more robust, flexible, and user-friendly. If you encounter any issues or have questions, feel free to consult the updated documentation or seek community support.
Thank you for using Automock, and we hope you enjoy the new features and improvements in v2.0!