Running Unit Tests written in CoffeeScript

Chutzpah supports running unit tests you write in the CoffeeScript 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 CoffeeScript in the samples folder.

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

## <reference path="../code/code.coffee" />

test "A basic test", ->
  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.coffee file and search for matching .js files that your compile step generates. Notice the syntax for referencing other files. For CoffeeScript files Chutzpah uses comments that start with ## to indicate a reference declaration.

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