Releases: suites-dev/suites
Suites v3.0.0
Suites 3.0.0 Release 🎉
We are thrilled to announce the release of Suites 3.0.0, the next evolution in testing frameworks, building on the strong foundation laid by Automock.
Automock has transitioned into Suites to better meet the needs of modern software development. Automock will continue to receive critical bug fixes, but all new features and improvements will be part of Suites. This release marks a significant milestone in enhancing the developer experience and expanding the capabilities of our testing tools.
🚀 Major Changes from Automock
Automock has officially transitioned to Suites, starting from version 3.0.0
to avoid any confusion. Automock will stop at version 2.1.0
and will only receive critical bug fixes going forward. Suites brings a plethora of improvements and a refined API.
🛠️ API Changes and Enhancements
-
Async
TestBed.compile()
:TestBed.compile()
is now asynchronous to support dynamic importing. This change requires the use ofasync/await
. -
TestBed.create
is nowTestBed.solitary
: For clearer semantics,TestBed.create()
has been renamed toTestBed.solitary()
. This change is part of introducingsociable
testing. -
New
.sociable()
Functionality: We've added a new.sociable()
method to the TestBed API, allowing for more flexible and realistic unit tests. Learn more about Sociable Tests -
Unified Imports: All Suites functionalities are now exported from
@suites/unit
, regardless of the adapters installed. Instead of importing from@automock/jest
or@automock/sinon
, you now import from@suites/unit
. -
New
Mocked
Type: Replacingjest.Mocked
orSinonStubbedInstance
, the newMocked
type from@suites/unit
supports deep mocking of class properties. -
API Changes in TestBed:
.mock.using()
is now.mock.impl()
.mock.final()
provides final mock behavior without runtime stubs and does not allow retrieval fromunitRef
.
🆕 Additional Features
- Vitest and ESM Support: Suites now supports Vitest and ECMAScript Modules (ESM), making it more versatile and future-proof.
🔧 Migration Tool
We are developing a migration tool to help you seamlessly transition from Automock to Suites. Stay tuned for updates and check out the Migration Guide for more details.
📚 Documentation
For comprehensive details on all changes and how to migrate, please refer to the Suites Documentation.
Happy testing! 🎉
v2.1.0
What's Changed
🚀 Features
- adapters.inversify: add inversifyjs adapter initial package (#206) (f1b395b) [Closes #106]
- adapters.nestjs: add post install script (e397886)
- adapters.nestjs: export identifier metadata to align with common (12e4ad4)
- common: identifier metadata type resolution (f748e1f)
- core: add identifier metadata object in proper interfaces (f664206)
- core: change mock container resolving strategy (e3708e7)
- jest: unit reference overload methods for identifier metadata (f8c77cf)
- sinon: unit reference overload methods for identifier metadata (4f952f0)
🐛 Bug Fixes
- core: fix typo in adapter error (0dc5fdb)
- core: stringify identifier metadata in logger warning (0ef0b92)
- core: typo in unit reference error message (b444356) @yaron-shamul
v2.0.0
Automock 2.0.0 🎊
This release introduces significant changes to the Automock library, aiming to enhance its adaptability, maintainability, and developer experience. The changes are a culmination of feedback, the need to support a broader spectrum of use-cases, and support variety of DI adapters.
🚀 Features
- jest: replace
jest-mock-extended
with native mocking functionality (6148f14) - sinon: replace
@golevelup/ts-sinon
with native mocking functionality (080117b) - types: simplify deep partial and stubbed instance types (8831892)
- adapters.nestjs: transition from dependencies map to container (9192234)
🔁 Code Refactoring
- jest: drop support for jest v25.x (18e1677)
- jest: drop support for native nestjs adapter (85432d0)
- jest: drop support for node v14 and v12 (ef2b729)
- jest: improve interfaces and remove types (4bc96e2)
- sinon: drop support for native nestjs adapter (0925ea2)
- sinon: drop support for node v14 and v12 (7d81ff2)
- sinon: improve interfaces and remove types (0292fed)
- sinon: update sinon and sinon types peer dependencies (5fa1ccf)
- common: drop support for node v14 and v12 (08f0678)
- common: overhaul interfaces and introduce new adapters mechanism (32ab0ab)
- core: drop support for node v14 and v12 (827ff5c)
- core: enhance dependency handling and error management (0271fe0)
⚙️ BREAKING CHANGES
jest
- Users will need to update their imports due to the relocation of
Type
andUnitTestBed
. Adjustments may be required for the newUnitReference
interface. - Remove built in support for NestJS adapter from package.json dependencies
- Drop support for jest v25.x, update package.json peer dependencies to new jest version range
- Setup engines for node to be v16 to v20, drop support for v12 and v14
- Remove export of
MockFunction
sinon
- Users will need to update their imports due to the relocation of
Type
,UnitTestBed
andMockFunction
. - Adjustments may be required for the new
UnitReference
interface. - The peer dependency for
sinon
has been narrowed from any version (*) to a specific range (10 - 16). Additionally, a new peer dependency for@types/sinon
with a version range of 9 - 10 has been introduced. Users should ensure they have the correct versions of sinon and@types/sinon
installed to avoid compatibility issues. - Remove built in support for NestJS adapter from package.json dependencies
- Setup engines for node to be v16 to v20, drop support for v12 and v14
types
- Removed array handling in
DeepPartial
and changed structure ofStubbedInstance
. This change narrows the type to only include stubbed members, removing the intersection with the original class type.
common
- Eliminate multiple interfaces and types:
ClassDependencies
,ClassCtorInjectables
,ClassInjectableProperty
,ClassPropsInjectables
,ClassDependenciesMap
,DependenciesReflector
- Transition from
PrimitiveValue
to the more descriptiveConstantValue
. - Setup engines for node to be v16 to v20, drop support for v12 and v14
core
- Transition from native
Error
to custom Automock errors - Update
UnitReference.get()
to return bothConstantValue
andStubbedInstance
. - Setup engines for node to be v16 to v20, drop support for v12 and v14
adapters.nestjs
- Modify export strategy: Shift from native literal export to default module export
v1.4.0
🚀 Features
-
common: add symbol and type for undefined dependency (681f670)
-
adapters.nestjs: support undefined dependency reflection (a9ccaa6)
-
core: support undefined dependency from adapter (b85132d)
Closes #84
🗒️ Release Notes
The improvements in version v1.4.0 of Automock are twofold, applying changes both in the core library (@automock/core
) and the NestJS adapter (@automock/adapters.nestjs
) to enhance the class reflection process and better handle scenarios where dependencies are detected as "undefined."
Enhancements in @automock/core
In @automock/core
, we have focused on strengthening the class reflection logic to handle undefined
values encountered during dependency detection. Previously, when the reflector encountered cases where the type of a dependency could not be determined or was reflected as undefined
, it posed challenges in the unit testing process, potentially leading to runtime errors or unexpected behavior.
To address this, the core library now accommodates undefined
values during class reflection, ensuring a more robust and flexible reflection process. The introduction of Symbol
as a placeholder for undefined
dependencies allows Automock to proceed with class mocking and unit testing without interruption, even in the presence of circular dependencies or circular file imports.
Enhancements in @automock/adapters.nestjs
The NestJS adapter, @automock/adapters.nestjs
, plays a critical role in reflecting class dependencies for NestJS applications. To align with the improvements in the core library, we have also made updates to the NestJS adapter to properly handle undefined
values during class reflection.
When @automock/core
triggers the class reflection process using the NestJS adapter, it now correctly identifies undefined
values for dependencies and replaces them with the Symbol
placeholder. This ensures seamless integration with the NestJS framework and eliminates potential issues arising from unresolved dependencies.
v1.3.1
What's Changed
- fix(adapters.nestjs): fix broken reflection when initiate class by @omermorad in #80
Full Changelog: v1.3.0...v1.3.1
v1.3.0
🐛 Bug Fixes
🚀 Features
🗒️ Release Notes
-
Release of
@automock/sinon
We are thrilled to announce the release of@automock/sinon
🎊 , a new package in the Automock ecosystem. This package provides seamless integration with the Sinon library. Now, you can enjoy the benefits of automatic mocking and stubbing with Sinon, powered by Automock's core principles. -
Introducing a new feature - property injection strategy.
Automock now offers a property injection strategy, giving you the flexibility to choose between property injection and constructor injection when setting up your class dependencies. You can also combine both strategies together to tailor your testing approach according to your needs. This feature provides more flexibility in your testing scenarios and allows for a different approach to isolating and testing individual components.
v1.2.3
v1.2.2
Enhancements
common
- refactor(common): change dependencies reflector signature (96d33a2)
BREAKING CHANGES: ThereflectDependencies
method ofDependenciesReflector
now returns a different interface to accommodate the support for both constructor parameters and properties.
adapters.nestjs
- refactor(adapters.nestjs): tuples instead of map when collecting dependencies (8c5c6cbe)
core
- refactor(core): dependencies mocker to return new interface (0881c0e4)
Fixes #67
By using tuples instead of maps, Automock now provides better support for injecting the same class or token multiple times and handles dependencies more accurately.
v1.2.0
v1.2.0 (2023-06-10)
Updates
This version brings a new feature that enhances support for dependencies requiring fixed values for injection. This feature specifically addresses scenarios where an injection token is used to inject a fixed value rather than a class.
Features
@automock/jest@1.1.0
Updates
This release brings exciting enhancements to the Automock ecosystem.
-
Logic moved to
@automock/core
: In this release, we have moved the core logic from@automock/jest
to@automock/core
. This change allows for better organization and separation of concerns within the project. -
Monorepo structure: The project has transformed into a monorepo structure, which means it is now composed of granular packages. Each package serves a specific purpose, providing more flexibility and modularity for different use cases.
What's Changed
- @automock/jest: function solely as a testbed, rely on
@automock/core
(d9b2db1)
Full Changelog: https://github.com/automock/automock/compare/@automock/jest@1.0.1...@automock/jest@1.1.0