suites-dev/suites
A unit testing framework for TypeScript backends working with inversion of control and dependency injection
15 Releases
Latest: 1mo ago
v3.1.1Latest
๐ Changes
- `unit`
- [#1020](https://github.com/suites-dev/suites/pull/1020) fix(unit): remove direct Mocked and Stub exports to fix TS2300 duplicate identifier, closes [#1017](https://github.com/suites-dev/suites/issues/1017) ([@omermorad](https://github.com/omermorad))
Suites v3.1.0v3.1.0
๐ฆ v3.1.0 (2025-05-05)
- Documentation: https://suites.dev/docs
- Installation: https://suites.dev/docs/get-started/installation
- > Note: Vitest 4.x requires Node.js >= 20. If you are using the Vitest adapter on Node 18, stay on Vitest 3.x or upgrade Node.
- `doubles.vitest`
- [#1013](https://github.com/suites-dev/suites/pull/1013) fix(doubles.vitest): skip non-writable properties in proxy set trap, closes [#966](https://github.com/suites-dev/suites/issues/966) ([@omermorad](https://github.com/omermorad))
- [#1013](https://github.com/suites-dev/suites/pull/1013) fix(doubles.vitest): use raw target object for descriptor lookup in overrideMockImp ([@omermorad](https://github.com/omermorad))
- `doubles.jest`
- [#1013](https://github.com/suites-dev/suites/pull/1013) fix(doubles.jest): skip non-writable properties in proxy set trap ([@omermorad](https://github.com/omermorad))
- + 23 more
โจ New Contributors ๐
- @HarrySky made their first contribution in https://github.com/suites-dev/suites/pull/783
- @omermorad
- @iddan
v3.0.1
๐ Bug Fixes ๐
- di.inversify, di.nestjs: reflect metadata peer dependency by @qballer (https://github.com/suites-dev/suites/pull/463) Closes #541
- core: add missing return for instantiated exposed classes by @craig0990 ([#529](https://github.com/suites-dev/suites/issues/529)) Closes #509
- di.inversify: change interface import to type by @omermorad ([#547](https://github.com/suites-dev/suites/issues/547))
- doubles.jest: remove redundant import by @omermorad ([315422a](https://github.com/suites-dev/suites/commit/315422a59c7d9804f9d0e6e3d0d24e16f3a95d44))
- doubles.vitest: remove redundant import by @omermorad ([09dc869](https://github.com/suites-dev/suites/commit/09dc869de94b0953be4589c447a66fd5f2b5a40c))
- doubles.sinon: remove redundant import by @omermorad([c8c2337](https://github.com/suites-dev/suites/commit/c8c23378fde83e1ad34cead9919119a84d4447ce))
โจ New Contributors ๐
- @qballer made their first contribution in https://github.com/suites-dev/suites/pull/452
- @craig0990 made their first contribution in https://github.com/suites-dev/suites/pull/529
- Full Changelog: https://github.com/suites-dev/suites/compare/v3.0.0...v3.0.1
Suites v3.0.0 ๐v3.0.0
๐ ๐ ๏ธ 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](https://suites.dev/docs/developer-guide/unit-tests/sociable)
- 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.
๐ ๐ Documentation
- For comprehensive details on all changes and how to migrate, please refer to the [Suites Documentation](https://suites.dev/docs).
- Happy testing! ๐
v2.1.0
โจ ๐ Features
- adapters.inversify: add inversifyjs adapter initial package ([#206](https://github.com/automock/automock/issues/206)) ([f1b395b](https://github.com/automock/automock/commit/f1b395bf0cd7274fc8adebf1bab61d97920c2839)) [Closes #106]
- adapters.nestjs: add post install script ([e397886](https://github.com/automock/automock/commit/e397886ff6f92aaf5214c2700e54fed42e7c81a7))
- adapters.nestjs: export identifier metadata to align with common ([12e4ad4](https://github.com/automock/automock/commit/12e4ad4c3f2911591cf104e8b6fdcba0e7d6c74d))
- common: identifier metadata type resolution ([f748e1f](https://github.com/automock/automock/commit/f748e1ff9c8d92199db3c13bc920d94c2e4c99dc))
- core: add identifier metadata object in proper interfaces ([f664206](https://github.com/automock/automock/commit/f664206b4a46d56faaf17f597fb2506c16ff9cde))
- core: change mock container resolving strategy ([e3708e7](https://github.com/automock/automock/commit/e3708e779d4efd143e9805ecff04458fb8e38da8))
- jest: unit reference overload methods for identifier metadata ([f8c77cf](https://github.com/automock/automock/commit/f8c77cfcc4877e7ef39677f9e5e0c46956d75cb2))
- sinon: unit reference overload methods for identifier metadata ([4f952f0](https://github.com/automock/automock/commit/4f952f0a8063926afbb20a998f1da8b248610838))
๐ ๐ Bug Fixes
- core: fix typo in adapter error ([0dc5fdb](https://github.com/automock/automock/commit/0dc5fdb980e4eb32a75753b43c13f657a4df2d7e))
- core: stringify identifier metadata in logger warning ([0ef0b92](https://github.com/automock/automock/commit/0ef0b9237b2ae02aa3c8ff9a9c25a071a4b3fa1a))
- core: typo in unit reference error message ([b444356](https://github.com/automock/automock/commit/b4443562718e89619673500367e8480a24689933)) @yaron-shamul
- [Full Changelog](https://github.com/automock/automock/compare/v2.0.0...v2.1.0)
v2.0.0
โจ ๐ Features
- jest: replace `jest-mock-extended` with native mocking functionality ([6148f14](https://github.com/automock/automock/commit/6148f143e1ac439b7d09d9cc7ba331c86aa6405e))
- sinon: replace `@golevelup/ts-sinon` with native mocking functionality ([080117b](https://github.com/automock/automock/commit/080117b07738f25d4e9e6428159834a848e3e2cf))
- types: simplify deep partial and stubbed instance types ([8831892](https://github.com/automock/automock/commit/883189234ba008695499464eda4a15e65bf81374))
- adapters.nestjs: transition from dependencies map to container ([9192234](https://github.com/automock/automock/commit/919223465d949eb5c39422592b07504a96a6e8a9))
โป๏ธ ๐ Code Refactoring
- jest: drop support for jest v25.x ([18e1677](https://github.com/automock/automock/commit/18e1677006698c8c5c566751451e48576a6d6bca))
- jest: drop support for native nestjs adapter ([85432d0](https://github.com/automock/automock/commit/85432d041892bf7875d57d200cfe1af653a06003))
- jest: drop support for node v14 and v12 ([ef2b729](https://github.com/automock/automock/commit/ef2b729c8db4e23d7f4eb7c54f56c8a0350e051b))
- jest: improve interfaces and remove types ([4bc96e2](https://github.com/automock/automock/commit/4bc96e20c3ba54aabd23dbe6d09e0074e424b4c8))
- sinon: drop support for native nestjs adapter ([0925ea2](https://github.com/automock/automock/commit/0925ea2bd729c291f97c496d63142ce5ed353b3c))
- sinon: drop support for node v14 and v12 ([7d81ff2](https://github.com/automock/automock/commit/7d81ff24e93e1d07770f46a4d6c420491ea41c5f))
- sinon: improve interfaces and remove types ([0292fed](https://github.com/automock/automock/commit/0292fed7309d05e7b31a616bcad9b23c814c882b))
- sinon: update sinon and sinon types peer dependencies ([5fa1ccf](https://github.com/automock/automock/commit/5fa1ccfc34dc83af763e58da5fe5a73a95a843c3))
- + 4 more
๐ฆ 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
โจ ๐ Features
- common: add symbol and type for undefined dependency ([681f670](https://github.com/omermorad/automock/commit/681f670ad93f5d6bc000ca946c14e0837bff73ea))
- adapters.nestjs: support undefined dependency reflection ([a9ccaa6](https://github.com/omermorad/automock/commit/a9ccaa646289320d631b3f783ff9d51639b7dc1b))
- core: support undefined dependency from adapter ([b85132d](https://github.com/omermorad/automock/commit/b85132d65ec4a5be7327597c47b29a4f281ff1ef))
- Closes #84
v1.3.1
๐ What's Changed
- fix(adapters.nestjs): fix broken reflection when initiate class by @omermorad in https://github.com/automock/automock/pull/80
- Full Changelog: https://github.com/automock/automock/compare/v1.3.0...v1.3.1
v1.3.0
๐ ๐ Bug Fixes
- core,common: add array type to primitive values (fixed values) ([#78](https://github.com/omermorad/automock/issues/78)) ([b7f57a1](https://github.com/omermorad/automock/commit/b7f57a10e7ff3a231a2a69ba7ad3d6c79941ce82)) (Closes #76)
โจ ๐ Features
- core,adapters.nestjs,common: support property injection strategy ([#75](https://github.com/omermorad/automock/issues/75)) ([ce4c08d](https://github.com/omermorad/automock/commit/ce4c08dde68d63f95b766fa0b942d7794069d0bf)) (Closes #64)
๐ฆ ๐๏ธ Release Notes
- Release of `@automock/sinon`
- Introducing a new feature - property injection strategy.
v1.2.3
๐ Changes
- deps(jest): bump `@automock/core` to version 1.2.2 ([0a4eb6c8](https://github.com/omermorad/automock/commit/0a4eb6c80026973e82dfbb256e46734293a267ad))
- fix(core): broken import from common src ([8d2326a3](https://github.com/omermorad/automock/commit/8d2326a3ec33853214de767aa90ebd46517fd234))
v1.2.2
๐ Changes
- refactor(common): change dependencies reflector signature ([96d33a2](https://github.com/omermorad/automock/commit/96d33a28c97ad93c8bd27d50b4bdf8ab43d11308))
- refactor(adapters.nestjs): tuples instead of map when collecting dependencies ([8c5c6cbe](https://github.com/omermorad/automock/commit/8c5c6cbee97790add30570b79684481780d25bea))
- refactor(core): dependencies mocker to return new interface ([0881c0e4](https://github.com/omermorad/automock/commit/0881c0e468951166be3afe14454bb45d319859bd))
v1.2.0
โจ Features
- common: add primitive value type ([#57](https://github.com/omermorad/automock/issues/57)) ([6e62fde](https://github.com/omermorad/automock/commit/6e62fdeafa2956a23ab550935edb6e596d162531))
- adapters.nestjs: support primitive value type in dependencies ([#56](https://github.com/omermorad/automock/issues/56)) ([ce2e779](https://github.com/omermorad/automock/commit/ce2e77942d4d1ac72025877735b1b51969c8671f))
- core: support primitive value in testbuilder api ([#59](https://github.com/omermorad/automock/issues/59)) ([ef01f7c](https://github.com/omermorad/automock/commit/ef01f7ccc95867c66f992e78d7de90c353e53671))
@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](https://github.com/omermorad/automock/commit/d9b2db19385721eb4999279171a3c91b7342cdd8))
- Full Changelog: https://github.com/automock/automock/compare/@automock/jest@1.0.1...@automock/jest@1.1.0
@automock/jest@1.0.1
๐ What's Changed
- chore(*): convert automock to monorepo structure by @omermorad in https://github.com/omermorad/automock/pull/28
- fix(jest): interface and string token combination by @iddan in https://github.com/omermorad/automock/pull/30
- Full Changelog: https://github.com/omermorad/automock/compare/@automock/jest@1.0.0...@automock/jest@1.0.1
@automock/jest@1.0.0
๐ What's Changed
- refactor: general refactoring by @omermorad in https://github.com/omermorad/automock/pull/5
- refactor: turn the unit builder to be more generic, remove nestjs stuff by @omermorad in https://github.com/omermorad/automock/pull/8
- feat: support angular-kit metadata (for angular and nestjs) by @omermorad in https://github.com/omermorad/automock/pull/17
- refactor: remove `mockof` and use `jest.mocked` instead by @omermorad in https://github.com/omermorad/automock/pull/19
- refactor: add support for different kinds of injections by @omermorad in https://github.com/omermorad/automock/pull/20
- Full Changelog: https://github.com/omermorad/automock/commits/@automock/jest@1.0.0
