jasmine / jasmine-gem

Jasmine ruby gem
682 stars 274 forks source link

Configuring asset expansion #268

Closed juanca closed 7 years ago

juanca commented 8 years ago

Hello,

I am in the process of bumping my jasmine-gem version from ~1.x to 2.4 in a rails 4 stack. It was a pretty smooth ride. However, the last blocker is

** Invoke jasmine:ci (first_time)
** Invoke jasmine:require_json (first_time)
** Execute jasmine:require_json
** Invoke jasmine:require (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute jasmine:require
** Invoke jasmine:configure (first_time)
** Execute jasmine:configure
** Invoke jasmine:configure_plugins (first_time)
** Execute jasmine:configure_plugins
** Execute jasmine:ci
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:52581, CTRL+C to stop
Waiting for jasmine server on 52581...
jasmine server started
!! Unexpected error while processing request: undefined method `find_asset' for nil:NilClass

It seems Jasmine::AssetExpander is somehow running without an assets_environment.

However, if I were to bypass asset expanding (which is an actual requirement for me), it doesn't run into this problem: src_paths.flatten.uniq

Is there an official configuration to bypass asset expansion? Our CI environment precompiles all assets beforehand so asset expansion is unnecessary anyways.

juanca commented 8 years ago

Well, for the time being, I forked @ https://github.com/juanca/jasmine-gem If y'all want this type of solution, I can make it configurable? Lemme know.

slackersoft commented 7 years ago

We would be happy to review a pull request that allows a user to turn off asset expansion or correctly boots up the assets_environment correctly in this situation. I would prefer to get the assets_environment booted up correctly, since that would make it work without users needing to set another configuration option, and it keeps the asset pipeline as more of an implementation detail.

juanca commented 7 years ago

Unfortunately, we just ended up moving off of rails for our front-end specs. I can open a PR but I won't be digging further into this issue.

Closing this unless someone wants to take the torch.