I am using ember-cli 0.0.35 and injecting a dependency on my component through an initializer. It works great in development, but there is no property when I run tests. It seems like testing calls loadInitializers, but the dependency is not displayed on this. An object ({});
I do not want to manually enter it for tests. Is there a better way to handle this?
Initializer:
var FooServiceInitializer = {
name: 'foo',
initialize: function (container, application) {
application.inject('component:foo', 'foo', 'service:foo');
}
};
export default FooServiceInitializer;
Failed test:
moduleForComponent('bar', 'Component: Bar', {
setup: function() {
App = startApp();
component = this.subject({});
},
teardown: function () {
Ember.run(App, App.destroy);
}
});
test('Properties: foo', function() {
ok(component.foo, 'foo is injected');
});
source
share