Andrew Arrow
Andrew Arrow

Reputation: 4565

why does jasmine-node throw this error when trying to require a spec file with coffee v1.6.2?

This worked fine with coffee v1.4 and v1.5 but the latest version now makes jasmine node throw a weird error when I run:

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)

And yet if I just run

jasmine-node --coffee --forceexit spec/unit
or
jasmine-node --coffee --forceexit spec/integration

it works fine. It just can't handle the root level spec folder. The line Object.jasmine.executeSpecsInFolder is doing is just require(filename_of_a_spec) don't understand why this would be a unexpected # error.

Upvotes: 0

Views: 453

Answers (1)

Andrew Arrow
Andrew Arrow

Reputation: 4565

The problem was a comment in one of the spec files!

I had a ### at the bottom with some commented out tests but there was a whitespace problem with the spaces before the first # char.

Upvotes: 1

Related Questions