Closed
Description
- VSCode Version: 1.4.0
- OS Version: Win 10
- TypeScript Version: 2.0 beta (also set with
"typescript.tsdk": "./node_modules/typescript/lib"
)
Steps to Reproduce:
- Create project with /src and /test folders.
- Create tsconfig.json with:
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"rootDir": "src/",
"outDir": "lib/",
"inlineSourceMap": true,
"inlineSources": true
},
"exclude": [
"node_modules",
"test"
]
}
- Run
npm install --save @types/node
- Create /test/test.ts and import
assert
.
The assert
import leads to "Cannot find module 'assert'".
The reason why I excluded test
in tsconfig.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 via mocha --require ./test/init.js test/**/*.ts
:
{
"compilerOptions": {
"module": "commonjs",
"inlineSourceMap": true,
"inlineSources": true
},
"exclude": [
"node_modules"
]
}
The init.js
file that is require'd by mocha contains:
require('ts-node').register({
project: 'test/',
disableWarnings: true,
fast: true
})
Metadata
Metadata
Assignees
Labels
No labels