I`m trying to write tests with Protractor and Jasmine in TypeScript. TSD is now deprecated so I have to use 'Typings' to manipulate TypeScript definitions. So I installed it:
npm install typings -g
Then I used it to install Jasmine and Chance definitions like that:
typings install jasmine --source dt --save –-global
typings install chance--source dt --save –-global
And I also added “files” section and excluded 'node_modules':
// tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"declaration": false,
"noImplicitAny": false,
"outDir": "tmp",
"types": ["node", "jasmine", "chance"]
},
"files": [
"typings/index.d.ts"
],
"include": [
"lib",
"specs"
],
"exclude": [
"node_modules"
]
}
The problem is neither WebStorm nor Visual Code studio can`t find definitions for all Jasmine methods and 'chance' module. Errors are:
**“TS2304: Cannot find name 'describe'”**
**“TS2307: Cannot find module 'chance'”**
respectively. Here is my spec file:
In 'typings/' folder I see reference links to TypeScript definitions:
Am I missing something? Why my IDE can`t find definitions for Jasmine and Chance?
P.S. Test works after transpiling to Javacript.
P.S.S. Errors will disappear after adding
///<reference path="###"/>
to the spec file. But I don`t want to use it.
Protractor: 4.0.9;
TypeScript 2.0.3;
Typings 1.5.0;
Thanks in advance!