Как использовать модуль node.js 'nodeunit' с файлами coffeescript

Я пытаюсь заставить модуль nodeunit работать в проекте coffeescript, но не могу пройти даже базовый тест. запустить. Вот мой пример Coffeescript require 'nodeunit'

test = true
test2 = false

exports.testSomething = (test) ->
  test.expect(1)
  test.ok(true, "this should pass")
  test.done()

exports.testSomethingElse = (test2) ->
  test2.expect(1)
  test2.ok(false, "this should fail")
  test2.done()

К сожалению, когда я запускаю '$ nodeunit example.coffee', я получаю сообщение об ошибке:

example.coffee:4 exports .testSomething = (test) -> ^

module.js: 296 throw err; ^ SyntaxError: Unexpected token> at Module._compile (module.js: 397: 25) в Object..js (module.js: 408: 10) в Module.load (module.js: 334: 31) {{1} } в Function._load (module.js: 293: 12) в require (module.js: 346: 19) в /usr/local/lib/node/nodeunit/lib/nodeunit.js:75:37 в / usr / local / lib / node / nodeunit / deps /async.js:508:13 в /usr/local/lib/node/nodeunit/deps/async.js:118:13 в / usr / local / lib / node / nodeunit /deps/async.js:134:9 в /usr/local/lib/node/nodeunit/deps/async.js:507:9

Может ли кто-нибудь помочь мне просто получить упрощенный тест и работает в Coffeescript с использованием Node.js?

Заранее спасибо

7
задан Brian Renzenbrink 3 November 2011 в 19:44
поделиться