Add Hogfather.Create() factory.

This commit is contained in:
Ian Gulliver
2015-12-25 14:23:04 -08:00
parent 30a3e89bfc
commit 7be8b4e9b6
2 changed files with 57 additions and 13 deletions

View File

@@ -947,7 +947,7 @@ QUnit.asyncTest('sendMessage admin ACL', function(assert) {
QUnit.module('Hogfather');
QUnit.asyncTest('Construct/shutdown', function(assert) {
QUnit.test('Construct/shutdown', function(assert) {
assert.expect(4);
var cosmo = new Cosmopolite(null, randstring());
@@ -956,7 +956,24 @@ QUnit.asyncTest('Construct/shutdown', function(assert) {
var hogfather = new Hogfather(cosmo, randstring());
assert.ok(true, 'new Hogfather()) succeeds');
window.setTimeout(function() {
hogfather.shutdown();
assert.ok(true, 'Hogfather.shutdown() succeeds');
cosmo.shutdown();
assert.ok(true, 'Cosmopolite.shutdown() succeeds');
});
QUnit.asyncTest('Create', function(assert) {
assert.expect(5);
var cosmo = new Cosmopolite(null, randstring());
assert.ok(true, 'new Cosmopolite() succeeds');
Hogfather.Create(cosmo).then(function(hogfather) {
assert.ok(true, 'Hogfather.Create() succeeds');
assert.ok(hogfather, 'Hogfather.Create() returns something');
hogfather.shutdown();
assert.ok(true, 'Hogfather.shutdown() succeeds');
@@ -964,6 +981,5 @@ QUnit.asyncTest('Construct/shutdown', function(assert) {
assert.ok(true, 'Cosmopolite.shutdown() succeeds');
QUnit.start();
}, 10 * 1000);
});
});