Closed tomdale closed 8 years ago
Not to future self, we need to add a moduleForHelper
that allows specifying a template (or template name).
Still need to flesh out what that API should look like (do we pass the template to this.subject()
or what?)...
my plan was to just be able to provide a snippet of handlebars as the "unit under test" that created a container view and rendered it, this way, you write your tests the same way you write your code. You don't typically call a handlebars helper imperatively, but rather in your templates.
I was going to refactor moduleForComponent, moduleForView, and moduleForSnippet??? to all use the same code to set up and tear down the container. I had this in my original stuff before the deep qunit integration was proposed and implemented (it was lovely).
On Tue, Jul 15, 2014 at 1:51 PM, Robert Jackson notifications@github.com wrote:
Not to future self, we need to add a moduleForHelper that allows specifying a template (or template name).
Still need to flesh out what that API should look like (do we pass the template to this.subject() or what?)...
— Reply to this email directly or view it on GitHub https://github.com/rjackson/ember-qunit/issues/76#issuecomment-49083355.
I wrote this demo of how to test the output of a provided template a while back (for plain QUnit):
Related #5
Currently I use ember-legacy-views for testing the helpers in ember-intl, but that's no longer possible as of ember-beta/ember-canary for 2.6.x.
Is there a recommended path forward?
/cc @rwjblue
@jasonmit - Support for the legacy addons is no longer present in 2.6.0-beta.1 or above. If someone still needs those addons, they will need to continue using 2.4 LTS (which is supported until 2.8 turns into the next LTS). tldr; no, there is nothing you can do but drop support. Also, I am confused why that question is related to this request for a moduleForHelper
...
This issue is being addressed by https://github.com/emberjs/rfcs/pull/119.
Also, I am confused why that question is related to this request for a moduleForHelper...
I took a similar approach that you mention https://github.com/rwjblue/ember-qunit/issues/76#issuecomment-49085412 here to test the output of my helpers.
@jasonmit - With the current tooling, using moduleForComponent
is massively simpler. See https://github.com/aptible/dashboard.aptible.com/blob/master/tests/integration/helpers/eq-test.js for an example.
Ah, it worked perfectly - thanks!
We should add helpers for testing bound Handlebars helpers.