-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serve EmberCLI tests as mountable engine #90
Conversation
Unfortunately, this doesn't yet work. The Any ideas? cc: @rwjblue @rwz @rondale-sc |
This is amazing. Thanks for this great work! We could maybe perform a naive gsub before serving the html to replace |
Also, why remove |
@@ -1,4 +1,4 @@ | |||
require "ember-cli/railtie" if defined?(Rails) | |||
require "ember-cli/engine" if defined?(Rails) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwz if the railties / engine is only loaded when Rails
constant exists, we're really dependent on Rails, not railties.
If Rails is included in the dependencies (which it should be, this being ember-cli-rails
and all), then engines and railties come along for the ride, right?
If not, I'll gladly add it back to the gemspec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails
constant is defined in railties
. So in this particular case we're depending on either rails
or railties
. I don't really have a hard preference on either of those, but one of them definitely should be there.
Also, what do you think about implicitly mounting the engine in development environment? But maybe use less obvious namespace, like |
I am against implicitly mounting the engine. What happens if people want to configure the URL? We could add another configuration value: EmberCLI.configure do |config|
config.tests_root = "/my-ember-cli-tests"
end Or we could just depend on the pre-existing API provided by Rails engines. For users who don't care about this feature, they're opted out by default, and don't have to worry about our obscure URL convention conflicting with their existing routes. Also, requiring an explicit mount frees us from worrying about catch-all routes. # config/routes.rb
# this would have precedent over our route
match "*route-to-ember" => "ember#index"
# this would match before the catchall
mount EmberCLI::Engine => "tests"
match "*route-to-ember" => "ember#index" |
It's worth noting that This doesn't seem to affect the test runnner, though |
It seems to be an empty dummy file: https://github.com/ember-cli/ember-cli/blob/v0.1.15/lib/broccoli/testem.js Seems like we could safely ignore the fact it's missing. The other option would be to add something like this to routes: get 'testem', to: ->(*){ [200, {}, [""]] }, format: :js |
... or even better, handle it in the middleware. :) |
Closes #18 Expose EmberCLI test suite through Rails
For the time being, I'm ok with it 404ing. |
Serve EmberCLI tests as mountable engine
Thanks again, you did an awesome job implementing this feature. 👍 👍 👍 Do you want to be a maintainer if the gem? You seem to care and put in a ton of work implementing features. We could definitely use all the help we could get from highly motivated people like you :) |
@rwz I'd love to! |
@seanpdoyle done. |
@seanpdoyle @rwz 👍 🍻 |
Closes #18
Expose EmberCLI test suite through Rails