-
Notifications
You must be signed in to change notification settings - Fork 237
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
Exclude test files from compilation but include for plugin processing #605
Comments
You will need a separate tsconfig.json that includes your test files along with the necessary compiler options and files to build the appropriate context. They are excluded in the above project, so TypeScript will effectively treat them as standalone files when opened. |
It the problem only applies for jest, you can add this to your jest config:
|
For more info on working with multiple tsconfig.json files, see this StackOverflow answer. Basically you'd make use of the You may need to change how you run tsc --project tsconfig.production.json # or whatever you call your other tsconfig |
My tsconfig file currently looks like this
And my code is setup where my unit test files are located in a
tests
directory as a sibling of the source file, e.g.When I compile my code the current setup works find and ignores all unit test files during compilation. However, when I open the unit test files in Sublime with this configuration it can't find any of the global types that it should find from jasmine/karma/etc.
If I remove the unit test file from the
exclude
list in tsconfig, then it all starts working again.Is there a way to exclude files from TS compilation but still have the plugin process them correctly?
The text was updated successfully, but these errors were encountered: