-
Notifications
You must be signed in to change notification settings - Fork 184
Acceptance testing w/ ember-cli 1.13.8 #291
Comments
Also -note for anyone else watching ... if you just want to work around this you can do the import in start-app like I show above/then add "t" to your globals (test .jshintrc file). The real question here is how to use it w/out hacking on a global in test code |
Hmm. If you want to reference translations by key in tests, you're going to have to get access to the Ember.Test.registerHelper('t', function(app, key, context) {
return app.__container__.lookup('service:i18n').t(key, context);
});
import Ember from 'ember';
Ember.Test.registerHelper('t', function(app, key, context) {
return app.__container__.lookup('service:i18n').t(key, context);
});
export default function noop() {} |
Awesome! Thanks for the insight @jamesarosen |
@jamesarosen
then translation text
gives result as "undefined"
it gives error-
|
I believe |
First off - love this project and thanks for all the hours you've put in maintaining it :)
I just upgraded from ember-cli 1.13.6 to 1.13.8 and found that even though my start-app does an import like so ...
I started getting errors in application code that would reference it inside the assertion block (not hbs). This includes the following helper code to setup/register the service
I assume this is enough/over kill to get hbs code working in acceptance tests but how should I import "t" if I want to use it in my qunit assertions like so?
update
I ask because ember-cli now complains saying
...when I run the test shown above. When I "debug" the test I just see t["default"]["default"]["default"] on and on.
The text was updated successfully, but these errors were encountered: