查看Ember CLI docs,它表示要创建一个类似的集成测试:
import Ember from "ember";
import { module, test } from 'ember-qunit';
import startApp from '../helpers/start-app';
var App;
module('An Integration test', {
beforeEach: function() {
App = startApp();
},
afterEach: function() {
Ember.run(App, App.destroy);
}
});
test("Page contents", function(assert) {
assert.expect(2);
visit('/foos').then(function() {
assert.equal(find('.foos-list').length, 1, "Page contains list of models");
assert.equal(find('.foos-list .foo-item').length, 5, "List contains expected number of models");
});
});
问题是,此代码导致:
TypeError: undefined is not a function
如果我删除测试,我仍然会收到该错误。如果我删除模块,那么我没有得到错误。 (但是qunit也没有运行测试。)这是有道理的,因为它looks like ember-qunit
不会导出module
。
那么我想在这做什么?