#5197·ts-jest

[Feature]: Improve error message when transformation has no emit due to any error and `noEmitOnError: true`

Author: jet2jetCreated Feb 18, 2026Updated Jun 19, 2026

Feature Proposal

When tsconfig.json includes noEmitOnError: true and any compilation error occurs (including tsconfig.json is invalid or the source code has syntax error), ts-jest outputs error message as follows:

    Unable to process '/path/to/src/foo.test.mts', please make sure that `outDir` in your tsconfig is neither `''` or `'.'`. You can also configure Jest config option `transformIgnorePatterns` to inform `ts-jest` to transform /path/to/src/foo.test.mts

It is happy that the 'cause' error will be output.

Motivation

When investigating #5196, the above error message is output but was confusing. With Node.js debugging,

https://github.com/kulshekhar/ts-jest/blob/e3414886078c5a0b69ea4d1760e0af313c9acf6d/src/legacy/compiler/ts-compiler.ts#L211

above EmitOutput has diagnostics with cause errors, so I found the problem.

Example

No response