这与咖啡v1.4和v1.5一起工作正常,但最新版本现在使jasmine节点在我运行时抛出一个奇怪的错误:
jasmine-node --coffee --forceexit spec /
/Users/aa/bitium/copernicus/node_modules/coffee-script/lib/coffee-script/helpers.js:211
throw error;
^
SyntaxError: unexpected #
at Object.exports.throwSyntaxError (/Users/aa/bitium/copernicus/node_modules/coffee-script/lib/coffee-script/helpers.js:209:13)
at Object.parser.yy.parseError (/Users/aa/bitium/copernicus/node_modules/coffee-script/lib/coffee-script/coffee-script.js:245:20)
at Object.parse (/Users/aa/bitium/copernicus/node_modules/coffee-script/lib/coffee-script/parser.js:535:22)
at exports.compile.compile (/Users/aa/bitium/copernicus/node_modules/coffee-script/lib/coffee-script/coffee-script.js:36:25)
at Object.loadFile (/Users/aa/bitium/copernicus/node_modules/coffee-script/lib/coffee-script/coffee-script.js:179:28)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.jasmine.executeSpecsInFolder (/Users/aa/opensource/jasmine-node/lib/jasmine-node/index.js:136:7)
然而,如果我只是跑
jasmine-node --coffee --forceexit spec/unit
or
jasmine-node --coffee --forceexit spec/integration
它工作正常。它只是无法处理根级spec文件夹。 Object.jasmine.executeSpecsInFolder行正在做的只是require(filename_of_a_spec)不明白为什么这会是一个意想不到的#错误。
答案 0 :(得分:1)
问题是其中一个规范文件中的注释!
我在底部有一个###,其中有一些已注释掉的测试,但在第一个#char之前,空格存在空白问题。