-
Notifications
You must be signed in to change notification settings - Fork 31k
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
TypeScript "exclude" conflicts with types resolution #10285
Comments
The problem is that the test folder doesn't see the global install typings due to the existence of the tsconfig.json. You can either install the typing there are well or link to the typing using a typings.d.ts file having a content like this /// <reference path="../typings/index.d.ts" /> |
I see. Although I don't have a "typings/" folder anymore as I use the new typescript 2 way with the |
Then it should work as long as the node_modules folder is above the test folder. However I tried it and I couldn't make it work. Moving to the TS team to comment on this. |
OK. I found out what needs to be done. You need to add the typings you need to see in the test folder to the tsconfig.json file. Something like this to see the node typings installed via @types/node. {
"compilerOptions": {
"module": "commonjs",
"inlineSourceMap": true,
"inlineSources": true,
"types": [
"node"
]
}
} |
Opened microsoft/TypeScript#10221 |
"typescript.tsdk": "./node_modules/typescript/lib"
)Steps to Reproduce:
npm install --save @types/node
assert
.The
assert
import leads to "Cannot find module 'assert'".The reason why I excluded
test
intsconfig.json
is that the tests should not become part of the lib/ folder. Also, I have a separate tsconfig.json in the test/ folder which gets used by mocha viamocha --require ./test/init.js test/**/*.ts
:The
init.js
file that is require'd by mocha contains:The text was updated successfully, but these errors were encountered: