What am I doing wrong here? I'm using web essentials. I tried both AMD module syntax and commonjs.
common.auth.ts
import api = module("lib/api")
export function getAuthorizationHeader(): string {
...
}
export function setAuthorizationHeader(val: string): string {
...
}
my test.ts:
///<reference path="../dep/qunit/qunit.d.ts"/>
///<reference path="../lib/common.auth.ts"/>
///<reference path="../lib/common.auth.js"/>
import Auth = module('lib/common.auth')
test("authorization header is set", () => {
// arrange
var key = "Bearer ABDE1234";
// act
Auth.setAuthorizationHeader(key);
var header = Auth.getAuthorizationHeader();
// assert
ok(header === key, "The actual header does not match");
});
Chutzpah.auth.js:7: Can't find variable: Auth
Comments: Much improved AMD support has been release in [version 3.0](http://matthewmanela.com/blog/chutzpah-3-0-mocha-requirejs-and-more/)
common.auth.ts
import api = module("lib/api")
export function getAuthorizationHeader(): string {
...
}
export function setAuthorizationHeader(val: string): string {
...
}
my test.ts:
///<reference path="../dep/qunit/qunit.d.ts"/>
///<reference path="../lib/common.auth.ts"/>
///<reference path="../lib/common.auth.js"/>
import Auth = module('lib/common.auth')
test("authorization header is set", () => {
// arrange
var key = "Bearer ABDE1234";
// act
Auth.setAuthorizationHeader(key);
var header = Auth.getAuthorizationHeader();
// assert
ok(header === key, "The actual header does not match");
});
Chutzpah.auth.js:7: Can't find variable: Auth
Comments: Much improved AMD support has been release in [version 3.0](http://matthewmanela.com/blog/chutzpah-3-0-mocha-requirejs-and-more/)