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

No typechecking during running tests #219

Closed
ValeryLosik opened this issue May 18, 2017 · 2 comments
Closed

No typechecking during running tests #219

ValeryLosik opened this issue May 18, 2017 · 2 comments

Comments

@ValeryLosik
Copy link

  • Issue

No typechecking during running tests

  • Expected behavior

Expect to get typechecking errors inside tests.

  • Link to a minimal repo that reproduces this issue
    Repo is creating based on create-react-app with typescript

In component there is a not valid assignment,however tests are passing successfully.

@marcusjwhelan
Copy link

@ValeryLosik there is something wrong with your development environment if you are not getting an error with that. Also tests cannot run type checks since there are no types in the compiled code. TypeScript type checks are run on compile time. Also if you have an IDE that supports TypeScript you will get error messages while you are typing.

Correct me if I am wrong, ts-jest as far as I can tell simply is a connector for jest and TypeScript so you can test your compiled code more easily. I don't believe any testing framework can check the types from the compiled code.

Also I don't see jest json config.

@kulshekhar
Copy link
Owner

ts-jest is meant to handle only the 'testing with jest' part and nothing else. Type errors are typically handle by the IDE and/or the build/live reload process.

I haven't tried this but it might be possible to do what you want by setting the noEmitOnError flag.

Anyway, closing as this falls outside the scope of this project

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

3 participants