I am using Chutzpah to test my TypeScript, and it doesn't seem to recognize the Bing Maps CDN: "http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0". I tried including it as a reference path in the chutzpah.json file, but to no effect. Any idea what I might be doing wrong?
Source (MapViewer.ts):
/// <reference path="../scripts/typings/bingmaps/microsoft.maps.d.ts" />
module Viewers {
export class MapViewer {
private containerName: string;
private map: Microsoft.Maps.Map;
constructor(theContainerName: string) {
this.containerName = theContainerName;
this.map = new Microsoft.Maps.Map(document.getElementById(this.containerName));
}
}
Test (MapViewerTest.ts)
///<reference path="../../lib/jasmine/jasmine.d.ts"/>
///<reference path="../../../FrontEndTools.WebUI/Services/MapViewer.ts"/>
module Viewers {
describe("MapViewer tests",() => {
var viewer = null;
beforeEach(() => {
viewer = new MapViewer("myMapContainer");
});
it("should have a map",() => {
var result = viewer;
expect(result);
});
});
}
Running the test results in an error: 'MapViewer tests:should have a map' failed ReferenceError: Can't find variable: Microsoft in file://.../_Chutzpah.83.MapViewer.js.
Incidentally, the jQuery CDN works fine as a reference path. The tests for the source that has jQuery in it run successfully.
Chutzpah.json
{
"Framework": "jasmine",
"TestHarnessReferenceMode": "Normal",
"TypeScriptModuleKind": "CommonJS",
"TypeScriptCodeGenTarget": "ES5",
"References" : [
{ "Path": "FrontEndTools.WebUI/lib/knockout.js" },
{ "Path": "http://code.jquery.com/jquery-2.1.0.min.js" },
{ "Path": "http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0" }
]
}