coffeescript 프로젝트 내에서 작동하는 nodeunit 모듈을 얻으려고하고 있지만 기본 테스트를 실행할 수없는 것으로 보입니다. 가 여기 내 예제 커피 스크립트 은 'nodeunit'불행하게도node.it 모듈을 coffeescript 파일과 함께 사용하는 방법
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) 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
사람이 나를 그냥 단순화를 얻을 수 있도록 할 수 있습니다 Node.js를 사용하여 Coffeescript에서 테스트하고 실행 하시겠습니까?
미리 감사드립니다.
놀라운 탐정 작업. My $ NODE_PATH는 비었지만 다른 모듈은 신경 쓰지 않았습니다. 고맙습니다. –
@ user1028416 당신은 그의 대답을 올바른 것으로 표시해야합니다. 당신이 그것에있는 동안 대답을 +1하는 것을 고려하십시오. 우리는 스택 오버 플로우에 대한 cred를 위해 작업합니다. :) –