2
0
Fork 0
es5-ff-spa-loader/test/spec/test-boot.js
Willem 7b94313f90 prepare 0.3.0, moved example to main package.json and move
options.error/debug to options.boot
2016-11-17 19:05:26 +01:00

50 lines
1.2 KiB
JavaScript

define(['es5-ff-spa-loader'], function(FFSpaLoader) {
'use strict';
describe('Start loader', function() {
beforeEach(function () {
function emptyElement(element) {
var myNode = element;
while (myNode.firstChild) {
myNode.removeChild(myNode.firstChild);
}
}
emptyElement(document.head);
emptyElement(document.body);
});
it('FFSpaLoader start with error', function(done) {
FFSpaLoader.options.server.url = 'http://localhost:9999';
FFSpaLoader.start(function(err) {
if (err !== null) {
done();
} else {
fail();
}
});
});
it('FFSpaLoader starts', function(done) {
FFSpaLoader.options.server.url = 'http://localhost:9090/test';
FFSpaLoader.options.server.assets = '/static/spa-client-resources';
FFSpaLoader.start(function(err) {
if (err !== null) {
fail();
} else {
done();
}
});
});
it('FFSpaLoader starts again', function(done) {
FFSpaLoader.options.server.url = 'http://localhost:9090/test';
FFSpaLoader.options.server.assets = '/static/spa-client-resources';
FFSpaLoader.start(function(err) {
if (err !== null) {
fail();
} else {
done();
}
});
});
});
});