Repository navigation
v4.1.3 (2026-11-16)
v4.1.3 fixes accessors supplied to Jest and Vitest mocks and corrects unused-override warnings. @suites/unit@4.1.3 requires Core 4.1.3 so installs of Unit include the warning fix.
Published packages: @suites/core.unit@4.1.3, @suites/doubles.jest@4.1.3, @suites/doubles.vitest@4.1.3, and @suites/unit@4.1.3. The DI and shared-types package versions are unchanged.
Accessor behavior: During construction,
mock()and.mock(...).impl(...)no longer read or write enumerable supplied accessors. Enumerable getter/setter-backed objects are wrapped on first access instead of being written back through the setter during construction. Explicit writes to non-configurable accessor pairs now reach their setter. Tests relying on the previous call counts, write-back, or ignored writes may need updating.
This applies to accessors supplied in a mock implementation. An unconfigured class getter still receives the existing lazy mock default; Suites does not infer its value from the original class. For a fixed value such as isCli: false, configure it with .mock(ConfigService).impl(() => ({ isCli: false })). To spy on a getter, supply a configurable getter in .impl(...) first.
Bug Fixes
doubles.jest,doubles.vitest- Preserves getters and setters without evaluating them while configuring mocks, addressing #593. Enumerable getter/setter-backed objects are mocked lazily when accessed. (#1128, Jest fix, Vitest fix)
core.unit,unit
Enhancements
*- Adds a previous-release consumer compatibility check to package publication. The 4.1.3 release passed 30 comparisons using published 4.1.2 consumer tests across Jest/Vitest adapters and Node.js 22, 24, and 26, plus a subclass regression check. (#1134)
Full Changelog: v4.1.2...v4.1.3