mercredi 4 mars 2015

Import { module } from 'ember-qunit'

Looking over the Ember CLI docs, it says to create an integration test like so:



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");
});
});


The problem is, this code results in:



TypeError: undefined is not a function


If I remove the test, I still get that error. If I remove the module, then I don't get the error. (But neither does qunit run the test.) This makes sense, because it looks like ember-qunit doesn't export a module.


So what am I suppose to do here?





Aucun commentaire:

Enregistrer un commentaire