I'm getting this error with the recent update https://travis-ci.org/kellyselden/package-hint-historic-resolver/jobs/211522381#L648
Attempting to inject an unknown injection: 'service:config'
Maybe it doesn't like my service being named config
? I cleared travis cache and reran master to verify it is only ember 2.12 causing this.
I'm not sure this is a bug, unknown services were always supposed to throw an error. Unfortunately, this wasn't working right before, but was fixed during work on the factory for feature.
See https://github.com/emberjs/ember.js/pull/14850 for some background.
The issue was service stubbing in unit tests like this:
// with a service named `config`
let service = this.subject({
config: {
cacheTime: 34
}
});
no longer works. You need to register the stub service before the subject()
call now to pass the new Ember.inject.service()
assertion.
Alternatively, for unit tests, you can specify needs: ['service:config']
. This will ensure that the service is present in the container/registry when the assertion checks for it and still allows stubbing during creation as you show above.
Most helpful comment
Alternatively, for unit tests, you can specify
needs: ['service:config']
. This will ensure that the service is present in the container/registry when the assertion checks for it and still allows stubbing during creation as you show above.