jejacks0n / teaspoon

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

Use Spring, localhost server with coverage support #204

Closed brett-richardson closed 10 years ago

brett-richardson commented 10 years ago

Recently I have been experimenting with getting Teaspoon boot time down to an acceptable level for use with guard.

I tried running over spring with the spring-commands-teaspoon but didn't see any noticeable speed increase.

The following code mentioned in another issue seems to have fantastic results... but feels a little heavy handed.

require 'teaspoon/server'
Teaspoon::Server.class_eval do
  def start; end
  def url ; "http://localhost:#{ENV['PORT']}" ; end
end

The biggest problem IMO is that coverage seems impossible using this method.

Do you have any ideas towards a better red-green feedback loop for Teaspoon? If you could even just point me in the right direction I will try put together a PR.

jejacks0n commented 10 years ago

Coverage is a beast.

As far as your question goes, that solution seems reasonable for now, but I'm open to suggestions on how to simplify that and make it a configuration.

Question: when you're running your server normally with teaspoon, can you hit /assets/some_asset.js?instrument=true and tell me if that gets instrumented?

As far as I can tell, that should be the case, and if that's the case, then it is being instrumented when run from guard as well which should give you coverage reports, though there's several moving parts in that so maybe something is being lost.