-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fixed Mocha for CoffeeScript 1.7+ and Travis CI errors #6
Conversation
A temporary solution for this is to include the following line on your mocha.opts file:
|
Thanks for digging into this. Working through hubotio/hubot#863 and running basically into the same problems. |
@@ -9,7 +9,7 @@ module.exports = function(grunt) { | |||
test: { | |||
options: { | |||
reporter: 'spec', | |||
require: 'coffee-script' | |||
require: 'coffee-script/register' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package.json
still has [email protected] for development. So, probably need to bump that, or revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do revert this, we may be locking all future Hubot scripts to < CoffeeScript 1.7. I'm not sure what's the best way to go about this (perhaps some condition for Travis?), but I personally feel that we should just bump it as it should only affect newly generated scripts.
Sorry, my bad. It's the generator's CoffeeScript version that you're referring to. Yea, we can revert this.
I'm trying to think through this, and I'm having a hard time if scripts generated this will work with hubot as it is now, or if there needs to be support for newer coffeescript (ie hubotio/hubot#863) |
I tried generating a new script, then running
Looks like coffee-script needs to be a dependency (or dev dependency) of the generated script. |
I agree. You might have to add the latest CoffeeScript as a dependency (or at least a dev dependency) in the script template. I realised that it doesn't work too well even with CoffeeScript installed globally if it is done via a NVM environment. It works best with a local copy of CoffeeScript in its directory. |
When I ran test with the old file I had this error : Running mocha caught exception: Error: Command failed: /home/baremec/.node/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:210 throw new Error("Use CoffeeScript.register() or require the coffee-s ^ Error: Use CoffeeScript.register() or require the coffee-script/register module to require .coffee.md files. at Object.base.(anonymous function) [as .coffee] (/home/baremec/.node/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:210:17) I found a solution here : hubotio/generator-hubot#6
Conflicts: generators/script/templates/.travis.yml
Hi, I noticed that generator-hubot generates package.json which references very old coffeescirpt. How is the progress? https://github.com/github/generator-hubot/blob/v0.4.0/generators/script/templates/_package.json#L29 My package (hubot-test-helper) user want to use "yield". |
We will be updating all of Hubot to plain JavaScript soon, so this issue should go away. hubotio/evolution#4 |
Gruntfile.js
andtest
are not currently compatible with CoffeeScript 1.7+ and they return the following error when executed:According to CoffeeScript's change log:
These changes fixes the error for when CoffeeScript 1.7+ is installed globally.
Also, https://github.com/hubot-scripts/hubot-example (which uses ~1.6) should probably be removed or edited to reflect the recent changes (Yeoman generator).