Currently, I am utilizing Angular 1.4.9 in combination with Jasmine 2.2.0 and Chutzpah 4.2.0. My Angular code and unit tests are both written in TypeScript within Visual Studio 2015 Update 1.
The issue I am facing mirrors that which was previously discussed in this post: TypeScript - jasmine - Chutzpah - AngularJS. Despite my attempts to follow the accepted solution provided there (including adding /// <chutzpah_reference />
to the test typescript file for angular, angular mocks, and angular ui), I continue to encounter the error:
Can't find variable: angular in file X
I have also experimented with adding the js files to the chutzpah.json file after removing the aforementioned chutzpah reference includes (outlined below).
In addition, I enabled Chutzpah logging from Visual Studio Options-> Chutzpah -> Enable Chutzpah Tracing, reran the tests, and verified that the JS files were indeed being recognized. Furthermore, I am able to successfully run other tests in typescript with Chutzpah that do not rely on angular dependencies.
Any suggestions for resolving this issue?
{
"Framework": "jasmine",
"Compile": {
"Mode": "External",
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ]
},
"References": [
{
"Includes": [ "*/../project/app/*.ts", "../project/scripts/*.js" ],
"Excludes": [ "*/../project/app/*.d.ts" ]
}
],
"Tests": [
{
"Includes": [ "*/AppTests/*.ts" ],
"Excludes": [ "*/AppTests/*.d.ts" ]
}
]
}
The structure of the project directory follows a standard layout: The solution file contains, among others, 2 projects—one for the Web App and another for the Web App Tests.