mirror of
https://github.com/nasa/openmct.git
synced 2025-02-18 16:40:58 +00:00
[Framework] Spec for FrameworkInitializer
Complete specs for initial implementation of framework layer, WTD-518.
This commit is contained in:
parent
0feb7c9699
commit
bfcfa0127d
@ -1,14 +1,50 @@
|
||||
/*global define,Promise,describe,it,expect,beforeEach*/
|
||||
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,runs*/
|
||||
|
||||
/**
|
||||
* FrameworkInitializerSpec. Created by vwoeltje on 11/6/14.
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
["../src/FrameworkInitializer"],
|
||||
function (FrameworkInitializer) {
|
||||
"use strict";
|
||||
|
||||
describe("", function () {
|
||||
describe("The framework initializer", function () {
|
||||
var initializer;
|
||||
|
||||
function appender(name) {
|
||||
return function (value) {
|
||||
return Promise.resolve(value.concat([name]));
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
initializer = new FrameworkInitializer(
|
||||
{ loadBundles: appender("loader") },
|
||||
{ resolveBundles: appender("resolver") },
|
||||
{ registerExtensions: appender("registrar") },
|
||||
{ bootstrap: appender("bootstrapper")}
|
||||
);
|
||||
});
|
||||
|
||||
// Really just delegates work, can only verify the
|
||||
// order of calls.
|
||||
it("calls injected stages in order", function () {
|
||||
var result;
|
||||
|
||||
initializer.runApplication([]).then(function (v) { result = v; });
|
||||
|
||||
waitsFor(
|
||||
function () { return result !== undefined; },
|
||||
"promise resolution",
|
||||
250
|
||||
);
|
||||
|
||||
runs(function () {
|
||||
expect(result).toEqual(
|
||||
["loader", "resolver", "registrar", "bootstrapper"]
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user