-
Notifications
You must be signed in to change notification settings - Fork 81
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
Jasmine test runner isn't available: Connection refused - connect(2) #103
Comments
You need to set the port manually if you set a jasmine url, because the port isn't extracted from the url, instead a random one is searched: guard 'jasmine', :server => :jasmine_gem, :port => 8888, :jasmine_url => 'http://localhost:8888/', :server_timeout => 120 do
watch(%r{spec/compiled_javascripts/spec\.(js\.coffee|js|coffee)$}) { "spec/compiled_javascripts" }
watch(%r{spec/compiled_javascripts/.+_spec\.(js\.coffee|js|coffee)$})
watch(%r{app/assets/javascripts/(.+?)\.(js\.coffee|js|coffee)$}) { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" }
end |
I still seem to get the same errors after adding the port.
|
After you have started Guard, does the Jasmine runner work at the given url? |
hitting the url http://localhost:8888/ does work (which it didn't before). |
Does starting Guard::Jasmine manually after Guard has started work? 19:07:05 - INFO - Guard::Jasmine starts Unicorn test server on port 8888 in development environment.
19:07:06 - INFO - Waiting for Jasmine test runner at http://localhost:8888/jasmine
19:07:15 - INFO - Guard is now watching at '/Users/michi/Repositories/myproject'
[1] guard(main)> jasmine
19:08:24 - INFO - Run Jasmine
19:08:24 - INFO - Run all Jasmine suites
19:08:24 - INFO - Run Jasmine suite at http://localhost:8888/jasmine
19:08:29 - INFO - Finished in 0.732 seconds
19:08:29 - INFO - 251 specs, 0 failures
19:08:29 - INFO - Done.
[2] guard(main)> |
And the different URLs it tries for each spec are valid URL. I have never used jasmine outside of a headless environment so not entirely sure what it should look like (I am switching for jasmine-webkit-headless) but it seems to be a bunch of dashes which I assume is simulating green dots. |
I get the same error when I run jasmine manually in Guard. |
I do not use the Jasmine gem in any of my projects, so it's hard to tell what the problem is. I always use it in the asset pipeline and for projects that are not a Rails app, I just define a mini Rails app just for the Jasmine specs, because I like to have Sprockets to handle all the dependencies. You can have a look at the Haml Coffee Assets project for the complete spec setup. @carhartl opened an issue 5 days ago about running the Jasmine gem on Travis CI and he said the Jasmine gem works fine for him locally. So I suppose it's a configuration issue in your setup. |
In case it wasn't explicit, adding the additional params to the guard statement did fix the problem of the jasmine server coming up. Might be good to clarify that in the README. I was following the instructions in the non-asset pipeline section. I just pointed to the jasmine server and looked in the console and see a bunch of dependancy errors, so that is likely what is causing my current problem. |
1.12.0 is out that uses the correct jasmine url for the Jasmine gem if you do not specify the port and jasmine_url option. |
Thanks for you help. |
So when I use the jasmine_gem server I do no longer have to specify jasmine_url and port option? |
Yes, it should work out of the box now. |
Yes, it does. Thanks, awesome, removed the duplication 👍 |
I discovered what the other problem was. I had a bad character in one of my Coffeescript specs which was causing the jasmine runner to die with a NOT_FOUND_ERR: DOM Exception 8. I put a break point in where it was breaking and tracked it to the bad spec.
instead of
Notice the semi-colon instead of comma. |
When I run guard I keep getting:
I don't get any errors when I manually start the jasmine server (rake jasmine). If I start the jasmine server before running guard then I get:
Below is my guard statement:
guard-jasmine-debug http://localhost:8888/ doesn't give any additional info.
Any help you can give would be much appreciated.
The text was updated successfully, but these errors were encountered: