Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fail all tests or exit jest when there are TSC errors? #250

Closed
masters3d opened this issue Jun 17, 2017 · 4 comments
Closed

How to fail all tests or exit jest when there are TSC errors? #250

masters3d opened this issue Jun 17, 2017 · 4 comments

Comments

@masters3d
Copy link
Contributor

masters3d commented Jun 17, 2017

  • 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

exercism/typescript#39 (comment)

@masters3d
Copy link
Contributor Author

masters3d commented Jun 17, 2017

related: #219

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

@masters3d masters3d changed the title How do I fail the linter when there are TSC errors? How do I fail the all tests or jest when there are TSC errors? Jun 17, 2017
@masters3d masters3d changed the title How do I fail the all tests or jest when there are TSC errors? How to fail all tests or exit jest when there are TSC errors? Jun 17, 2017
@masters3d
Copy link
Contributor Author

related: #79

Seems to be a limitation on the compiler to emit errors
microsoft/TypeScript#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

@masters3d
Copy link
Contributor Author

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

masters3d added a commit to masters3d/ts-jest that referenced this issue Jun 17, 2017
@AlexGalays
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants