Ts-jest: How to fail all tests or exit jest when there are TSC errors?

Created on 17 Jun 2017  路  4Comments  路  Source: kulshekhar/ts-jest

  • Issue

How do I fail the jest's tests when there are TSC errors?

  • Expected behavior

Tests failing if TSC gives errors

  • Link to a minimal repo that reproduces this issue

https://github.com/exercism/xtypescript/issues/39#issuecomment-309239812

Most helpful comment

It was so surprising to discover ts-jest doesn't check for compilation errors ! This is especially bad in watch mode.

All 4 comments

related: https://github.com/kulshekhar/ts-jest/issues/219

In this sample repo: https://github.com/masters3d/xts-jest-hello-world
all tests pass but there are compiler errors.

related: https://github.com/kulshekhar/ts-jest/issues/79

Seems to be a limitation on the compiler to emit errors
https://github.com/Microsoft/TypeScript/issues/4864

We could get diagnostics but then how does Jest display those. Tricky.
https://github.com/Microsoft/TypeScript/blob/master/src/compiler/types.ts#L2441

We are just going to use tsc --noEmit -p . && jest --no-cache

It was so surprising to discover ts-jest doesn't check for compilation errors ! This is especially bad in watch mode.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

japhar81 picture japhar81  路  3Comments

AlexGellert picture AlexGellert  路  4Comments

ozum picture ozum  路  4Comments

golddranks picture golddranks  路  3Comments

qm3ster picture qm3ster  路  3Comments