Inject real service in Ember.js test
There is no straightforward howto on injecting real services in Ember components/controllers/routes when you test them, instead of mocking them.
Well. I just do this dirty thing:
`import startApp from 'listly/tests/helpers/start-app'`
...
App = startApp();
realExceptionService = App.__container__.lookup('service:servicename');
Written by Esteban
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ember.js
Authors
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/63020/wojtek-medium.jpg)
ryrych
11.63K
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/59899/ja.jpg)
michalbryxi
6.651K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#