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

Updated Wiki: typescript

$
0
0

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.


Viewing all articles
Browse latest Browse all 1864

Trending Articles



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