Release Notes
This page lists breaking changes and notable new features. Please be sure to read the release notes before upgrading from previous version.
The detailed changelog can be found in TSTyche repository on GitHub .
TSTyche 6.0
TSTyche 6.0 ships with a major rewrite of the .toBe() matcher. The new implementation compares types by checking their structure. Previously, the internal .isTypeIdenticalTo() method of the type checker was used, but that approach will not work with TypeScript 7. The rewrite ensures TSTyche can support TypeScript 7 in the future (to follow updates, subscribe to issue #443 ).
Requirements
Breaking! The minimum supported Node.js version is 22.12. It is recommended to use the latest LTS release .
TypeScript Versions
Breaking! The minimum supported TypeScript version is 5.4. Support for TypeScript <=5.3 is dropped.
Matchers
.toBe()
The new implementation of .toBe() brings several improvements to the matcher. Now it considers the following types as identical:
{ a: string } & { b: number }and{ a: string; b: number };((a: string) => string) & ((b: number) => number)and{ (a: string): string; (b: number): number };({ a: string } | { b: number }) & ({ a: string } | { b: number })and{ a: string } | { a: string; b: number } | { b: number }.
Previously ignored, this parameters, const type parameters or NoInfer markers are now taken into account:
(this: unknown) => voidis not() => void;<const T>(arg: T) => Tis not<T>(arg: T) => T;<T>(arg: NoInfer<T>) => Tis not<T>(arg: T) => T.
All of the above works with any complexity and at any depth.
Plugins
Breaking! Support for plugins is removed. Most of use cases should be covered by the comment directives.