-
Notifications
You must be signed in to change notification settings - Fork 41
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
running node 6.9.2 'yield' is reserved #41
Comments
I couldn't reproduce it. |
it's kind of hard im just writing an hubot script extension and im pretty bad at coffeescript. so im not sure if im doing it right. All i did was to copy paste in the example from the readme, install the dependencies and then run npm test |
Could you show me following things?
|
package.json
Shrinkwrap
the last thing you wanted i have no idea. Im running npm test and that in turn is running some grunt thing to compile the code and run the tests. There are so many libraries and so much crap that is needed just to write a single test for your code. and the error messages are horrible. Im sorry im just so frustrated right now. |
Could you try running test for this repo?
https://github.com/mtsmfm/hubot-test-helper/tree/master/dummy is minimal example. |
I found your repo (https://github.com/Tandolf/hubot-gocd-client) |
don't spend too much time on it, it's probably me and im probably doing something wrong. |
Don't worry 😉 I can pass your test on my machine via docker:
So your code isn't wrong. |
if you check the tests it's just dummy tests, it's when i was trying to implement your tests locally that the tests fail. So what you are seeing in the repo isn't what i have locally. |
the "yield" test |
So you can pass your "dummy" test on your machine (I'm not native english speaker so I worry about misunderstanding 😓 ) |
im gonna try to explain this. In my repo you see the tests, those tests pass and i havn't written them. they were generated when i created the project from the yo-generator that is provided by github/hubot. Its when im trying to run
locally on my machine i suddenly get the exception i have posted in the beginning, that mocha doesn't know what "yield" is. it is calling it as reserved. i have the latest versions of everything, and im running node 6.9.2. all i want is to test my code, and my hubot is making a rest-call to an external service so i need to "sleep" the execution so that hubot can post back before i assert. But i can't get your code to run. |
I found the cause. |
Since 1.9.0 coffee-script supports |
i upgraded coffeescript to 1.12.3 and it's still not working, tried chaining the method with .then but i don't get the test to pass. It's some kind of race condition. Im going to give up, im sorry if i took up your time. |
Don't worry 😄
How about using https://github.com/Tandolf/hubot-gocd-client/blob/master/Gruntfile.js#L10 diff --git a/package.json b/package.json
diff --git a/Gruntfile.js b/Gruntfile.js
index 30deb8a..feac40e 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -7,7 +7,7 @@ module.exports = function (grunt) {
test: {
options: {
reporter: 'spec',
- require: 'coffee-script'
+ require: 'coffee-script/register'
},
src: ['test/**/*.coffee']
}
diff --git a/package.json b/package.json
index 70437a5..60f4bc2 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,8 @@
"devDependencies": {
"bluebird": "^3.4.7",
"chai": "^2.1.1",
- "coffee-script": "1.6.3",
+ "co": "^4.6.0",
+ "coffee-script": "latest",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-watch": "~0.6.1", |
wait what, now it's working! okey, explain this to me, what just happened? |
1.6.3 is too old, so we must update generator-hubot's template I think. |
i used https://hubot.github.com/docs/scripting/#creating-a-script-package But thank you so much for all your help, im so sorry if i took up your time. |
Don't worry. |
trying to get the tests to run on node 6.9.2 and all im getting is:
`Running "mochaTest:test" (mochaTest) task
The text was updated successfully, but these errors were encountered: