Skip to content

Releases: suites-dev/suites

Suites v3.0.0

13 Jul 13:59
Compare
Choose a tag to compare

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 of async/await.

  • TestBed.create is now TestBed.solitary: For clearer semantics, TestBed.create() has been renamed to TestBed.solitary(). This change is part of introducing sociable 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: Replacing jest.Mocked or SinonStubbedInstance, the new Mocked 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 from unitRef.

🆕 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

09 Dec 14:29
Compare
Choose a tag to compare

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

Full Changelog

v2.0.0

14 Nov 15:32
Compare
Choose a tag to compare

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 and UnitTestBed. Adjustments may be required for the new UnitReference 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 and MockFunction.
  • 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 of StubbedInstance. 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 descriptive ConstantValue.
  • 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 both ConstantValue and StubbedInstance.
  • 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

06 Aug 04:55
61822a1
Compare
Choose a tag to compare

🚀 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

30 Jul 04:19
Compare
Choose a tag to compare

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

29 Jul 12:13
Compare
Choose a tag to compare

🐛 Bug Fixes

  • core,common: add array type to primitive values (fixed values) (#78) (b7f57a1) (Closes #76)

🚀 Features

  • core,adapters.nestjs,common: support property injection strategy (#75) (ce4c08d) (Closes #64)

🗒️ 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

25 Jul 20:19
Compare
Choose a tag to compare

Dependencies

jest

  • deps(jest): bump @automock/core to version 1.2.2 (0a4eb6c8)

core

  • fix(core): broken import from common src (8d2326a3)

Closes #74

v1.2.2

18 Jul 05:01
88cbfab
Compare
Choose a tag to compare

Enhancements

common

  • refactor(common): change dependencies reflector signature (96d33a2)
    BREAKING CHANGES: The reflectDependencies method of DependenciesReflector 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

10 Jun 17:33
Compare
Choose a tag to compare

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

  • common: add primitive value type (#57) (6e62fde)
  • adapters.nestjs: support primitive value type in dependencies (#56) (ce2e779)
  • core: support primitive value in testbuilder api (#59) (ef01f7c)

@automock/jest@1.1.0

03 Jun 16:56
Compare
Choose a tag to compare

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