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

Fixed Mocha for CoffeeScript 1.7+ and Travis CI errors #6

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(grunt) {
test: {
options: {
reporter: 'spec',
require: 'coffee-script'
require: 'coffee-script/register'
Copy link
Member

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.

Copy link
Author

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.

},
src: ['test/**/*.coffee','test/**/*.js']
}
Expand Down
4 changes: 3 additions & 1 deletion generators/script/templates/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ node_js:
- "0.11"
- "0.10"
notifications:
email: false
email: false
before_script:
- npm install coffee-script grunt-cli
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we get failures without this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

About 2 weeks ago I enabled Travis CI for all my scripts. On Node 0.11, I seemed to be getting errors related to Grunt not being found, and on 0.10, it was the: Warning: Cannot find module 'coffee-script/register'� Use --force to continue. error. Installing both of them before running the tests seemed to resolve the problem for me.

EDIT: Assuming that we do end up adding CoffeeScript as a dependency (explicitly), then we can take the coffee-script portion out of it.

EDIT 2: Woops. Looks like it has already been done (41e0657). We can remove coffee-script from it then.

2 changes: 1 addition & 1 deletion generators/script/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function(grunt) {
test: {
options: {
reporter: 'spec',
require: 'coffee-script'
require: 'coffee-script/register'
},
src: ['test/**/*.coffee']
}
Expand Down
2 changes: 1 addition & 1 deletion generators/script/templates/script/test
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# bootstrap environment
source script/bootstrap

mocha --compilers coffee:coffee-script
mocha --compilers coffee:coffee-script/register