lundi 23 mars 2015

Integration tests in Ember CLI

I am having trouble getting started with testing in Ember CLI (v0.1.12). I have copied an integration test directly from the Ember CLI website into my integration tests folder, and modified it such that it should raise an error (code below). However it does not raise an error. It does not seem to be running when I run ember --serve.


If I remove the line



import { module, test } from 'qunit';


the test does run, but it passes without raising an error.


Are there additional setup steps that I have missed to get this working? Many thanks



import Ember from "ember";
import { module, test } from 'qunit';
import startApp from '../helpers/start-app';
var App;

module('user-login-test', {
beforeEach: function() {
App = startApp();
},
afterEach: function() {
Ember.run(App, App.destroy);
}
});

test("Page contents", function(assert) {
assert.expect(1);
visit('/').then(function() {
assert.equal(true, false, "Should raise an error!");
});
});




Aucun commentaire:

Enregistrer un commentaire