Skip to Content
What’s NewTSTyche 6

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.2

TSTyche 6.2 ships with the new dot reporter the --verbose command line option.

Reporters

dot

Prints a row of dots (·) for passing test files and crosses (×) for failed ones. Failures are listed at the end of the run.

To learn more, see the Reporters page.

Thanks to @voxpelli  for the idea!

Command Line

--verbose

Enable detailed logging.

TSTyche 6.1

TSTyche 6.1 ships with the new tstyche/tag entry point as well as the --quiet and --root command line options.

tstyche/tag

The tstyche/tag entry point provides a tagged template function that runs TSTyche programmatically using a zx inspired template literal API.

The function runs in the same process, streaming error messages and test results to the stderr and stdout in real-time.

Use the --quiet command line option to suppress standard output and focus solely on errors.

Usage

Call the function with the same arguments you would pass to the tstyche command:

import from "tstyche/tag"; // Equivalent to 'tstyche query-params --only multiple' await `query-params --only multiple`;

The function returns a promise that resolves if the test run is successful and rejects if it fails, making it suitable for runtime tests:

import from "node:test"; import from "tstyche/tag"; ("generate types", async () => { const = (import.meta); // ... await `--quiet --root ${}`; });

Command Line

--quiet

Silence all test runner output except errors and warnings.

--root

The path to a directory containing files of a test project.

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) => void is not () => void;
  • <const T>(arg: T) => T is not <T>(arg: T) => T;
  • <T>(arg: NoInfer<T>) => T is 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.

Last updated on