【发布时间】:2015-07-02 03:49:45
【问题描述】:
我正在尝试通过其中一项测试在我的应用程序中包含一个模块。甚至有可能做到这一点吗?我只能在“测试”目录中包含一个模块。 我不断收到臭名昭著的“找不到模块”错误。
http://localhost:4200/assets/test-support.js:5578:16: Could not find module d3graph/app/controllers/index imported from d3graph/tests/unit/utils/graph-helper-test
这是我的测试代码:
import { moduleFor, test } from 'ember-qunit';
import Ember from 'ember';
import helper from '../../../app/anything/anywhere'; // <- THIS LINE FAILS
moduleFor('util:graph-helper', 'Graph Helper', {
beforeEach: () => initialize()
});
function initialize() { /* something */ };
test('test desc', function(assert) {
var testObj = this.subject();
// test logic follows
});
我确实尝试了对模块路径的各种修改,包括从根目录开始的绝对路径,我什至尝试过通过“require()”包括在内,但可惜没有成功。 请帮忙。
【问题讨论】:
标签: ember.js ember-cli ecmascript-6