Running Unit Tests written in CoffeeScript

mmanela edited this page Sep 15, 2014 · 4 revisions

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/" />

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 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.

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.