-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Triple-slash reference affects all files instead of just the one file that contains it. #19978
Comments
We're having the same problem with Jest, which declares even more ambient definitions than mocha: If one unit test does |
What My recommendation here is to have your tests in a separate compilation, and they would include |
If we want VS Code IntelliSense for the unit tests, does that mean we need to create a separate package.json and/or tsconfig.json file? |
|
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
TypeScript Version: 2.4.2
Code
/// <reference types="mocha" />
Expected behavior:
Types from mocha are only available to the test ts file that include this triple-slash reference.
Actual behavior:
Types from mocha are available to all the ts files in the project, including both prod code and test code.
This is unexpected. How do we prevent Mocha test types from accidentally getting into prod code?
The text was updated successfully, but these errors were encountered: