jejacks0n / teaspoon

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

Regression: Teaspoon 1.1.2 does not parse `//= require` directives when config.assets.debug = false #447

Closed ajb closed 8 years ago

ajb commented 8 years ago

(Originally commented in https://github.com/modeset/teaspoon/issues/443#issuecomment-170619612)

Isolated test case repo here: https://github.com/ajb/teaspoon_bug

erichummel commented 8 years ago

in my own testing I can confirm that require directives are not being used, however the flag that worked for me (admittedly Teaspoon 1.1.4) was the suite.expand_assets = true in teaspoon_env.rb

This dramatically slows down my jasmine suites, and I would very much like to be able to serve a concatenated javascript blob rather than each individual file.

jejacks0n commented 8 years ago

It seems likely to be related to some recent changes required by sprockets, but only a few people have reported it, so I'd like others to chime in if this is the case, so I can try and resolve it and capture it in a spec. More details are needed.

erichummel commented 8 years ago

Wow - quick response - thanks. I'll see if I can find some more information that would help.

erichummel commented 8 years ago

my front end guy locked our sass-rails gem to an old version, which in turn was locking an old version of sprockets (2.3.3) - I suspect that this may have contributed to this issue (though not for @ajb's example repo). I'm gonna tinker some and let you know.

jejacks0n commented 8 years ago

if you check https://github.com/modeset/teaspoon/blob/master/lib/teaspoon/engine.rb#L99 you'll see a kinda ugly hack in there to work around the restrictions of sprockets 3+ -- I have an open issue (https://github.com/rails/sprockets-rails/issues/297) on sprockets-rails to see if @rafaelfranca has thoughts, but haven't heard back yet.

erichummel commented 8 years ago

cool. I now understand why my front end guy tried the sass-rails upgrade and gave up, I've got some work on another thing I work on to do now so won't be able to finish my investigations til monday (i'm gonna be miles away from my computer over the weekend).

thank you for being so responsive @jejacks0n, I will do my best to help out as best I can on monday.

jejacks0n commented 8 years ago

Yeah, I agree with the changes they've made with sprockets 3.0.0, but it'll probably throw a few kinks in for engines that were utilizing the less strict behavior in development environments.

erichummel commented 8 years ago

heh yeah. judging by a few issues in their repo it does seem to be throwing some people for a loop.

connorshea commented 8 years ago

So we just ran into this, any updates?

jejacks0n commented 8 years ago

I still don't know what's happening, and have not seen it as of yet.. any ideas on what's happening? like, literally, you get a js file served to you where you can see //= require [file]?

jejacks0n commented 8 years ago

I'm not seeing this, so am closing it.. if someone else has more to add it would be great.