Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix syntax error during cake test #45

Merged
merged 1 commit into from
Feb 22, 2014
Merged

fix syntax error during cake test #45

merged 1 commit into from
Feb 22, 2014

Conversation

brewingcode
Copy link
Contributor

Coffeescript 1.7.1 broke the mocha test. Found this solution at:

mochajs/mocha@2f42a83

The exact error looks like this:

set app environment: development

/private/tmp/express-coffee/test/app_test.coffee:1
xports, require, module, __filename, __dirname) { request = require 'supertest
^^^^^^^^^^^
SyntaxError: Unexpected string
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /usr/local/lib/node_modules/mocha/lib/mocha.js:172:27
at Array.forEach (native)
at Mocha.loadFiles
(/usr/local/lib/node_modules/mocha/lib/mocha.js:169:14)
at Mocha.run (/usr/local/lib/node_modules/mocha/lib/mocha.js:356:31)
at Object.
(/usr/local/lib/node_modules/mocha/bin/_mocha:359:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3

Coffeescript 1.7.1 broke the mocha test. Found this solution at:

mochajs/mocha@2f42a83

The exact error looks like this:

set app environment: development

/private/tmp/express-coffee/test/app_test.coffee:1
xports, require, module, __filename, __dirname) { request = require 'supertest
                                                                    ^^^^^^^^^^^
SyntaxError: Unexpected string
  at Module._compile (module.js:439:25)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at /usr/local/lib/node_modules/mocha/lib/mocha.js:172:27
  at Array.forEach (native)
  at Mocha.loadFiles
(/usr/local/lib/node_modules/mocha/lib/mocha.js:169:14)
  at Mocha.run (/usr/local/lib/node_modules/mocha/lib/mocha.js:356:31)
  at Object.<anonymous>
(/usr/local/lib/node_modules/mocha/bin/_mocha:359:16)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:902:3
@brewingcode
Copy link
Contributor Author

Errrr, this was changed 1.7.0, not 1.7.1. On reading the changelist for coffeescript, it's spelled out:

1.7.0 – JANUARY 28, 2014
When requiring CoffeeScript files in Node you must now explicitly register the compiler.
This can be done with require 'coffee-script/register' or CoffeeScript.register(). Also for
configuration such as Mocha's, use coffee-script/register.

twilson63 pushed a commit that referenced this pull request Feb 22, 2014
fix syntax error during `cake test`
@twilson63 twilson63 merged commit d0592da into twilson63:master Feb 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants