I can't get testing of TypeScript in VS using jasmine/Chutzpah to work with AMD.
Sample.ts:
export class Sample {
constructor(public name: string) { }
}
Simple.ts:
/// <reference path="./require.d.ts" />
/// <reference path="./jasmine.d.ts" />
import SampleModule = module("./Sample");
describe("TypeScript1", function () {
it("should pass a simple test", function () {
expect(1).toEqual(1);
});
});
describe("TypeScript2", function () {
it("should pass a sample test", function () {
var sample = new SampleModule.Sample("Wow");
expect(sample.name).toEqual("Wow");
});
});
...this results in:
Test Name: TypeScript1 should pass a simple test Test Outcome: Passed
Test Name: TypeScript2 should pass a sample test Test Outcome: Failed Test Duration: 0:00:00
Result Message: ReferenceError: Can't find variable: SampleModule in file:typescripthtmlapp1/_Chutzpah.28.simple.js (line 9)
Adding:
/// <reference path="./Sample.ts" />
...results in no detected tests.
What am I missing?