coffeescriptプロジェクト内でnodeunitモジュールを動作させようとしていますが、基本的なテストを実行することさえできません。node.itモジュールを 'coffeescript'ファイルで使用する方法
example.coffee:4 exports.testSomething = (test) -> ^
module.js:296 throw err; ^SyntaxError: Unexpected token > at Module._compile (module.js:397:25) at Object..js (module.js:408:10) at Module.load (module.js:334:31) at Function._load (module.js:293:12) at require (module.js:346:19) at /usr/local/lib/node/nodeunit/lib/nodeunit.js:75:37 at /usr/local/lib/node/nodeunit/deps/async.js:508:13 at /usr/local/lib/node/nodeunit/deps/async.js:118:13 at /usr/local/lib/node/nodeunit/deps/async.js:134:9 at /usr/local/lib/node/nodeunit/deps/async.js:507:9
誰も私だけの簡略化を得るのを助けることができます:ここに は、私が実行したときのCoffeeScript が、私はエラー出力を取得する '$ nodeunit example.coffee'、 '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()
を必要と私の例ですNode.jsを使用してCoffeescriptでテストして実行しますか?
ありがとうございます事前にありがとうございます
現象的な探偵研究。 My $ NODE_PATHは空ですが、私の他のモジュールは気にしませんでした。どうもありがとうございました。 –
@ user1028416あなたは彼の答えを正しいものとしてマークする必要があります。あなたがそれにいる間は、答えを+1することを検討してください。私たちは、Stack Overflowに関するcredについて働いています。 :) –