jejacks0n / teaspoon

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

PhantomJS attempts to parse CoffeeScript #155

Closed jalcine closed 10 years ago

jalcine commented 10 years ago

Each time I try to start up Teaspoon via Guard, I get:

Teaspoon running default suite at http://127.0.0.1:4374/teaspoon/default?file[]=/home/jacky/Development/Work/Companies/Vettio/Portcullis/spec/javascripts/lib/core_spec.js.coffee
Can't open '/home/jacky/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/teaspoon-0.7.8/lib/teaspoon/drivers/phantomjs/runner.coffee'

I've tried running this directly (like phantomjs runner.coffee) and it took me a minute to realize that maybe (just maybe) Phantomjs couldn't parse CoffeeScript. Is it possible to have this be precompiled somehow using Sprockets?

jalcine commented 10 years ago

I should note that I'm using guard-teaspoon as well. I decided to drop the use of it and just go straight with using it in the Web browser.

jalcine commented 10 years ago

Yup, it's right on https://github.com/modeset/teaspoon/blob/master/lib/teaspoon/drivers/phantomjs_driver.rb#L47.

Trying to invoke this from the command line just reports from PhantomJS an ability to load a file. I'm guessing this is still a bit raw :)

jejacks0n commented 10 years ago

no, it seems to work for everyone else. I assume you're running a really old install of phantom, or that you've somehow (unknown to me) setup things incorrectly.

jejacks0n commented 10 years ago

btw, the driver is intentionally coffeescript, because phantomjs can parse coffeescript in every scenario I've ever been exposed to.

jalcine commented 10 years ago

I'm running PhantomJS 1.9.0 on a Debian machine. My setup is quite vanilla, and I haven't made any modifications to the configuration made by guard init teaspoon.

jejacks0n commented 10 years ago

Can you tell me if passing it a js works? https://gist.github.com/jejacks0n/8286446

jejacks0n commented 10 years ago

Closing it then, since it's unreproducible to anyone else. Sorry you had to deal with the frustration.

simsalabim commented 10 years ago

The same thing here, phantomjs v 1.9.0, Ubuntu 13.10 64bit, teaspoon v. 0.7.7 I came with runner.js from @jejacks0n's gist above and succeed.

I have no idea what caused the issue but think it worth switching to js implementation of runner. Those who neither have any idea nor time and willing to investigate the issue can follow the same way, the only limitation is updating the gem and having the same problem again.

simsalabim commented 10 years ago

Update: Found this issue reported - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730087 I think it would be better to switch driver to js implementation from the gist in the repository. Since teaspoon depnds on phantom which cannot be bugless it would be better to reduce probability of such issues, moreover coffeescript is just a preprocessor and eventually javascript code is being executed. @jejacks0n ?

simsalabim commented 10 years ago

I mean the teaspoon team can keep writing runner in coffeescript but compile it into js before releasing the gem in production. It would be nice.

jejacks0n commented 10 years ago

meh, they're more or less the same.

jejacks0n commented 10 years ago

I'll probably circle back and clean up that javascript a bit more, but give it a shot and let me know. Thank you for doing the background to identify the issue -- since it's so OS specific it's hard for us to identify. =)

simsalabim commented 10 years ago

Recent version gem 'teaspoon', github: 'modeset/teaspoon' with js driver works fine for me.