jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Failure/Error: SyntaxError: Parse error #176

Closed MartinElvar closed 10 years ago

MartinElvar commented 10 years ago

So i just installed this gem, but it won't boot, i have install all dependencies, including the last version of PhantomJS, even tried with Selenium. But i keep getting this error, i have no idea. :/

Elvar ~/projects/sanatid (master) > rails g teaspoon:install --framework=qunit --coffee
   identical  config/initializers/teaspoon.rb
      create  test/teaspoon_env.rb
      create  test/javascripts/support
      create  test/javascripts/fixtures
      create  test/javascripts/test_helper.coffee
+============================================================================+
Congratulations! Teaspoon was successfully installed. Documentation and more can
be found at: https://github.com/modeset/teaspoon

Elvar ~/projects/sanatid (master) > teaspoon
Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:49464/teaspoon/default
F

Failures:

  1)  global failure (1, 0, 1)
     Failure/Error: SyntaxError: Parse error

Finished in 0.01700 seconds
1 example, 1 failure

Failed examples:

teaspoon -s default --filter="undefined global failure"
jejacks0n commented 10 years ago

You have a parse error in your js. Consider loading it in the browser to review, it might help you sort it out.

MartinElvar commented 10 years ago

@jejacks0n I don't get any errors in my browser. Also, it still fails when i comment.

= require application

->

require application

Is there i way i can get a verbose output, like a stacktrace?

jejacks0n commented 10 years ago

Not with that.. qunit logs them as a global exception.. are you familiar with qunit?

MartinElvar commented 10 years ago

@jejacks0n Hmm i tried to run rails generate teaspoon:install --coffee, and then manually change to qunit, which seems to do the trick.

Thank you for time @jejacks0n, and my apologies for the noise.

jejacks0n commented 10 years ago

hmm.. is there something wrong with the qunit spec_helper?

MartinElvar commented 10 years ago

@jejacks0n That could very well be, i tried to start a new rails app, and add teaspoon, still same issue. Maybe you can confirm?

jejacks0n commented 10 years ago

I believe it's in the initializer that's generated for qunit.. it's setting the helper to "spec_helper", which should read "test_helper".. I came across that while I was working on 0.8 last night. try changing that and see.

jejacks0n commented 10 years ago

https://github.com/modeset/teaspoon/blob/master/lib/generators/teaspoon/install/templates/qunit/initializer.rb#L36

It's been there for a long time.

MartinElvar commented 10 years ago

@jejacks0n That was indeed the issue. :smiley:

Before and After

http://cl.ly/image/1J0y0i3i1K0q