Skip to content

Suites v4.0.0

Choose a tag to compare

@suites-release-bot suites-release-bot released this 04 Nov 14:10
· 46 commits to master since this release
v4.0.0

v4.0.0 (2026-11-04)

Documentation: https://suites.dev/docs

Suites 4 adds support for Node.js 22, 24, and 26, NestJS 12, and Inversify 8, while retaining NestJS 10/11 and Inversify 7 compatibility. This release replaces postinstall type setup with explicit TypeScript references, updates Jest integration, and retires the unmaintained Sinon adapter. CommonJS and ESM remain supported.

Breaking changes: Upgrade your installed @suites/* packages together to version 4 and add the type references shown below. Node.js versions below 22, NestJS 8/9, and Inversify 6 are no longer supported.

Breaking Changes

  • *
    • Requires Node.js ^22.22.2 || ^24.15.0 || ^26.0.0. Support is limited to these three major lines. (#1098, @omermorad)
  • unit, doubles.jest, doubles.vitest, types.di
    • Installation no longer injects or edits type declarations. Add one test-double /unit reference and one DI /metadata reference to a declaration file included by your test tsconfig. Mocked and Stub remain available through imports from @suites/unit once the adapter augmentation is loaded. (#1098)
  • doubles.jest
    • Requires matching jest and @jest/globals versions satisfying ^30.5.2. Jest globals are loaded explicitly for both CommonJS and ESM. (b20daf3)
  • di.nestjs
    • Requires @nestjs/common in ^10.0.0 || ^11.0.0 || ^12.0.1. NestJS 10 and 11 users can upgrade Suites without changing their framework major. (145999b)
    • Loading @suites/di.nestjs/metadata rejects metadata arguments in mock() and get(). Omit those arguments when using NestJS. (b8c1f53)
  • di.inversify
    • Requires Inversify ^7.0.0 || ^8.0.0. Inversify 7 remains supported. When upgrading from Inversify 6, replace LazyServiceIdentifer with LazyServiceIdentifier, replace @targetName(value) with @named(value), and select named mocks with { named: value }. Use @injectFromBase() for inherited injection metadata. (b9520c8, d79e312)
    • Constructor parameters using @named(...) or @tagged(...) need an explicit @inject(Dependency). Plain class-typed parameters without these decorators can still use inferred injection.
  • doubles.sinon
    • Sinon support is removed. @suites/doubles.sinon is no longer discovered and will not receive a version 4 release. Remove it and migrate tests, stub calls, assertions, and type references to the Jest or Vitest adapter. (faa4c4c)

Features

  • di.inversify
    • Supports symbol properties and combined named/tagged injection metadata. (b9520c8)
  • di.nestjs, di.inversify
    • Export /metadata declaration entry points so each test project can select its DI metadata types explicitly. (b8c1f53, 5d5d350)
  • types.di
    • Custom DI adapters can augment IdentifierMetadataRegistry to supply their own metadata type. Without a DI reference, the generic metadata fallback remains available. (e984c0f)

Migration from Suites 3

Upgrade @suites/unit, your DI adapter, and your test-double adapter to version 4. Upgrade any directly installed Suites core or type packages at the same time.

For NestJS + Jest, create suites.d.ts:

/// <reference types="@suites/doubles.jest/unit" />
/// <reference types="@suites/di.nestjs/metadata" />

For Inversify + Vitest:

/// <reference types="@suites/doubles.vitest/unit" />
/// <reference types="@suites/di.inversify/metadata" />

Choose the matching references for your combination, and include the file in your test tsconfig. Include exactly one test-double reference and one DI reference per test TypeScript project. Imports continue to come from @suites/unit:

import { TestBed, type Mocked } from '@suites/unit';

Enhancements

  • *
    • Moves the repository development toolchain to Node.js 26, pnpm 12, and TypeScript 6. (#1098)
    • Tests the minimum and current releases of NestJS 10/11/12 and Inversify 7/8 with Jest and Vitest across Node.js 22/24/26, including dedicated NestJS ESM cases: 96 compatibility combinations across 18 E2E jobs. (#1098)

Full Changelog: v3.1.1...v4.0.0