0

アドオン コンポーネントの 1 つの統合テストを書いています。また、 npm linkを使用して兄弟プロジェクトにリンクしました:

.. projects/
.... my-project/
.... my-linked-project/

問題のコンポーネントでmy-linked-projectミックスインの1 つを使用します。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'

  1. render/hbsが呼び出され たときに何が起こるかについて、どこで詳しく読むことができますか?
  2. 問題は、外部リンクされたプロジェクトを見つけることができないテスト ファイルの場所でしょうか?
4

1 に答える 1

0

It's worth removing the npm link from tech equation temporarily to see if that's causing your problems. What you have there looks fine ...

于 2016-09-03T13:01:41.583 に答える