在集成测试中,我可以使用:
import getOwner from 'ember-owner/get';
然后
moduleForComponent('mycomponent', 'Integration | Component | mycomponent', {
integration: true,
beforeEach() {
const config = getOwner(this).resolveRegistration('config:environment');
在验收测试getOwner(this)
未定义且我必须在没有getOwner的情况下执行此操作的唯一选项是:
moduleForAcceptance('Acceptance | cool test', {
beforeEach() {
const config = this.application.__container__.lookupFactory('config:environment');
有什么建议吗?