I am using TypeScript 1.0 with Visual Studio 2012, Chutzpah 3.2.1.1 and Jasmine 2.
I have a very basic test which compiles fine, but does not pass using the Visual Studio Chutzpah Test Adaptor or the command line one.
I get the following error
ReferenceError: Can't find variable: MyProject in....
My project is structured like this:
**solution**
TypeScriptProject
X.ts
TestProject
chutzpah.json
compile.bat
Scripts\(contains typings)
Spec
TestX.ts
TypeScriptProject\X.ts
module MyProject {
export class X {
getValue(): number {
return 5;
}
}
}
TestProject\chutzpah.json
{
"Framework": "jasmine",
"Compile": {
"Extensions": [".ts"],
"ExtensionsWithNoOutput": [".d.ts"],
"Executable": "compile.bat"
},
"References": [
{ "Path": "../TypeScriptProject/X.ts"}
],
"Tests": [
{ "Path": "Spec"}
]
}
TestProject\compile.bat
@echo off
tsc Spec/TestX.ts ../TypeScriptProject/X.ts --sourcemap
TestProject\Spec\TestX.ts
/// <reference path="../Scripts/typings/jasmine/jasmine.d.ts"/>
/// <reference path="../../TypeScriptProject/X.ts"/>
describe("test x value", function(){
it("should", function(){
var x = new MyProject.X();
expect(x.getValue()).toEqual(5);
});
});
Since it compiles fine, the references in TestX.ts should be correct.
My problem seems to be different to Chutzpah running Jasmine in TFS 2012 can't find referenced file under test as I get the error in the Visual Studio test runner and seems to be talking about using Team Build.