How do I fail the jest's tests when there are TSC errors?
Tests failing if TSC gives errors
https://github.com/exercism/xtypescript/issues/39#issuecomment-309239812
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.
Most helpful comment
It was so surprising to discover ts-jest doesn't check for compilation errors ! This is especially bad in watch mode.