This release contains a few new features most notably that Chutzpah can now work directly on TypeScript files. You can get the new bits from CodePlex, NuGet or go to the Visual Studio Gallery to get the updated Visual Studio Context Menu Extension and Unit Test Explorer adapter for Visual Studio 2012.
Changes
- Added support for writing tests in TypeScript (item 67)
- Fixed encoding problem with .coffee files (item 63)
- Allow reference paths for folders (item 68)
- Some Unit Test Explorer bug fixes
- Added clearer error messages when test file does not exist
TypeScript Support
Chutzpah now supports running unit tests you write in TypeScript. Chutzpah will automatically generate temporary JavaScript files for your referenced TypeScript files and use those to gather the test results.
For example given a TypeScript test file that references another TypeScript file:
/// <reference path="../code/code.ts" /> test("will add 5 to number", function () { var res:number = mathLib.add5(10); equal(res, 15, "should add 5"); });
It will parse that file as well as the referenced code.ts files and generate corresponding .js files.
If you are writing QUnit tests be aware that you need to write QUnit.module instead of just module since module is a reserved word in TypeScript.
Referencing Folders
In your test files you can now reference folders using the reference declarations. For example when Chutzpah sees this line:
/// <reference path="../someFolder/" />
It will traverse that folder and add the files in it as references. This can be easier to manage than referencing many files individually.