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 5.0
TSTyche 5.0 ships with the new // @tstyche fixme comment directive and checkDeclarationFiles configuration option.
Requirements
Breaking! The minimum supported Node.js version is 20.12. It is recommended to use the latest LTS release .
TypeScript Versions
Breaking! Support for TypeScript 4.x is dropped.
expect()
Breaking! The .fail run mode flag is removed. Use the new // @tstyche fixme comment directive instead.
Matchers
Breaking! The .toBeAssignableWith() matcher is rename to .toBeAssignableFrom().
import { expect } from "tstyche";
- expect<Awaitable<string>>().type.toBeAssignableWith("abc");
+ expect<Awaitable<string>>().type.toBeAssignableFrom("abc");
- expect<Awaitable<string>>().type.not.toBeAssignableWith(123);
+ expect<Awaitable<string>>().type.not.toBeAssignableFrom(123);Comment Directives
// @tstyche fixme
Marks an expect(), test() or describe() as supposed to fail.
import { , } from "tstyche";
declare function (: () => unknown): void;
declare function (: () => <unknown>): <void>;
((() => {}))..<void>();
// @tstyche fixme -- This should work, see: #265
((() => .()))..<<void>>();
("() => unknown", () => {
((() => {}))..<void>();
});
// @tstyche fixme -- Known bug, see: #345
("() => Promise<unknown>", () => {
((() => .()))..<<void>>();
});The runner implements the following logic:
- when an
expect()is marked, make sure it actually fails, - when a
test()ordescribe()is marked, check if it has a failing child.
Configuration
Breaking! The checkSourceFiles configuration option is removed.
checkDeclarationFiles
Check declaration files for type errors.
To maximize performance TSTyche only checks types of test and fixture files. When checkDeclarationFiles is enabled, type errors are also reported for declaration and ambient files. In other words, all .d.ts files of the projected are checked. The files within the node_modules directory are not checked.
It is recommended to enable this option when a project has handcrafted or generated type declarations.
checkSuppressedErrors
The checkSuppressedErrors configuration option is enabled by default.
target
Breaking! The option value now must be a string in semver syntax:
- "target": [">=5.2 <=5.3", "5.4.2", ">5.5"]
+ "target": ">=5.2 <=5.3 || 5.4.2 || >5.5"The default value is changed to "*". When TypeScript is installed, it will use that version; otherwise, the latest version will be used.
The "current" value is not supported any more. Use "*" instead.
Command Line
--target
Breaking! The option value now must be a single string with version ranges separated by ||:
- --target '>=5.2 <5.3, 5.4.2, >5.5'
+ --target '>=5.2 <=5.3 || 5.4.2 || >5.5'The default value is changed to "*". When TypeScript is installed, it will use that version; otherwise, the latest version will be used.
The "current" value is not supported any more. Use "*" instead.
Compiler Options
Breaking! The allowJs and checkJs are removed from default compiler options.
As a reminder, from now TSTyche sets the following default compiler options:
{
"allowImportingTsExtensions": true,
"exactOptionalPropertyTypes": true,
"jsx": "preserve",
"module": "nodenext",
"moduleResolution": "nodenext",
"noUncheckedIndexedAccess": true,
"noUncheckedSideEffectImports": true, // only for TypeScript >=5.6
"resolveJsonModule": true,
"strict": true,
"target": "esnext",
"verbatimModuleSyntax": true
}