Running Unit Tests written in TypeScript

Matthew Manela edited this page Apr 5, 2015 · 5 revisions

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 [TypeScript in the samples folder|https://github.com/mmanela/chutzpah/tree/master/Samples/Compilation/TypeScript].

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

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

test("A basic test", function(){
  ok(true, "this test is fine");
  value = "hello";
  equal("hello", value, "We expect value to be hello");
});

Chutzpah will parse that file as well as the referenced code.ts file and search for matching .js files that your compile step generates.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.