Quantcast
Channel: Chutzpah - A JavaScript Test Runner
Viewing all articles
Browse latest Browse all 1864

Commented Issue: Can't find variable [71]

$
0
0
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/)

Viewing all articles
Browse latest Browse all 1864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>