我正在为我的一个插件组件编写一个集成测试。我还使用npm链路将其链接到一个兄弟项目
.. projects/
.... my-project/
.... my-linked-project/我在所讨论的my-linked-project组件中使用了一个my-project混频器。
//my-project/addon/components/my-component/component.js
import Ember from 'ember';
import ExternalMixin from 'my-linked-project/mixins/foo'
export default Ember.Component.extend(ExternalMixin, {
...
}这在运行应用程序时运行得很好,但在集成测试中,当我render它时,似乎遇到了一些问题。
//my-project/tests/integration/components/my-component-test.js
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('my-component', 'Integration description', {
integration: true
}
test('should render', function() {
this.render(hbs`{{my-component}}`);
}但是我得到了Error: Could not find module 'my-linked-project/mixins/foo'。
render / hbs时会发生什么?发布于 2016-09-03 13:01:41
暂时从技术方程中删除npm link是值得的,看看这是否导致了您的问题。你手上的东西看起来很好..。
https://stackoverflow.com/questions/39299594
复制相似问题