I am using Angular 1.4.9 with Jasmine 2.2.0 and Chutzpah 4.2.0 with both my Angular code and unit tests in TypeScript in Visual Studio 2015 Update 1.
My issue is identical to that posted previously TypeScript - jasmine - Chutzpah - AngularJS. I have attempted to implement the accepted answer over there (adding the /// <chutzpah_reference />
to the test typescript file for angular, angular mocks, and angular ui), however I still receive the error:
Can't find variable: angular in file X
I have also tried adding the js files to the chutzpah.json file after removing the above chutzpah reference includes (see below)
After this I enabled Chutzpah logging from Visual Studio Options-> Chutzpah -> Enable Chutzpah Tracing, re run the tests, and confirmed that the JS files were indeed being picked-up. I am also able to run others tests in typescript with Chutzpah that do not have angular dependencies.
Any ideas?
{
"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" ]
}
]
}
Project directory structure is rather standard: SLN file has, among others, 2 projects one for the Web App, and another for the Web App Tests.