This project is read-only.

Running Unit Tests written in TypeScript

Chutzpah supports running unit tests you write in the TypeScript language. You need to tell Chutzpah how to compile your files into JavaScript using the compile setting in the chutzpah.json file. There is an example of this for TypeScriptScript in the samples folder.

For example given a TypeScript test file that references another TypeScript file:

/// <reference path="../code/code.ts" />
/// <reference path="qunit.d.ts" />

test("will add 5 to number", function () {
    var res:number = mathLib.add5(10);
 
    equal(res, 15, "should add 5");
});

Chutzpah will parse that file as well as the referenced code.ts file and search for corresponding .js files that your compile setting produces.

Last edited Mar 11, 2014 at 10:29 PM by mmanela, version 5