2016-01-23 15:57:56 -08:00
|
|
|
/* global it:false */
|
|
|
|
|
/* global describe:false */
|
|
|
|
|
/* global before:false */
|
|
|
|
|
/* global after:false */
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
var appdb = require('../appdb.js'),
|
|
|
|
|
async = require('async'),
|
|
|
|
|
config = require('../config.js'),
|
2017-01-27 09:40:46 -08:00
|
|
|
constants = require('../constants.js'),
|
2016-01-23 15:57:56 -08:00
|
|
|
database = require('../database.js'),
|
|
|
|
|
expect = require('expect.js'),
|
2016-04-12 13:12:17 -07:00
|
|
|
mailer = require('../mailer.js'),
|
2016-01-23 15:57:56 -08:00
|
|
|
nock = require('nock'),
|
2017-02-06 16:33:55 -08:00
|
|
|
paths = require('../paths.js'),
|
|
|
|
|
safe = require('safetydance'),
|
2016-01-23 15:57:56 -08:00
|
|
|
settings = require('../settings.js'),
|
2017-04-13 23:19:37 -07:00
|
|
|
settingsdb = require('../settingsdb.js'),
|
2016-01-23 15:57:56 -08:00
|
|
|
updatechecker = require('../updatechecker.js'),
|
2017-04-14 01:13:42 -07:00
|
|
|
user = require('../user.js');
|
2016-01-23 15:57:56 -08:00
|
|
|
|
2016-04-12 13:12:17 -07:00
|
|
|
// owner
|
|
|
|
|
var USER_0 = {
|
|
|
|
|
username: 'username0',
|
|
|
|
|
password: 'Username0pass?1234',
|
|
|
|
|
email: 'user0@email.com',
|
|
|
|
|
displayName: 'User 0'
|
|
|
|
|
};
|
|
|
|
|
|
2016-05-01 20:01:34 -07:00
|
|
|
var AUDIT_SOURCE = {
|
|
|
|
|
ip: '1.2.3.4'
|
|
|
|
|
};
|
|
|
|
|
|
2016-04-12 13:15:40 -07:00
|
|
|
function checkMails(number, done) {
|
|
|
|
|
// mails are enqueued async
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
expect(mailer._getMailQueue().length).to.equal(number);
|
|
|
|
|
mailer._clearMailQueue();
|
|
|
|
|
done();
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-07 10:30:52 -08:00
|
|
|
function cleanup(done) {
|
|
|
|
|
mailer._clearMailQueue();
|
|
|
|
|
|
|
|
|
|
async.series([
|
|
|
|
|
settings.uninitialize,
|
|
|
|
|
database._clear
|
|
|
|
|
], done);
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-13 23:19:37 -07:00
|
|
|
describe('updatechecker - box - manual (mail)', function () {
|
2016-01-23 15:57:56 -08:00
|
|
|
before(function (done) {
|
2017-04-14 01:13:42 -07:00
|
|
|
config._reset();
|
2016-01-24 00:06:32 -08:00
|
|
|
config.set('version', '1.0.0');
|
2017-04-14 01:13:42 -07:00
|
|
|
config.set('apiServerOrigin', 'http://localhost:4444');
|
2017-04-13 23:19:37 -07:00
|
|
|
config.set('provider', 'notcaas');
|
2017-02-06 16:33:55 -08:00
|
|
|
safe.fs.unlinkSync(paths.UPDATE_CHECKER_FILE);
|
|
|
|
|
|
2016-01-23 15:57:56 -08:00
|
|
|
async.series([
|
2016-04-12 13:12:17 -07:00
|
|
|
database.initialize,
|
2017-04-13 23:19:37 -07:00
|
|
|
database._clear,
|
2017-02-07 10:30:52 -08:00
|
|
|
settings.initialize,
|
2017-01-27 09:40:46 -08:00
|
|
|
user.createOwner.bind(null, USER_0.username, USER_0.password, USER_0.email, USER_0.displayName, AUDIT_SOURCE),
|
2017-02-06 16:33:55 -08:00
|
|
|
settings.setAutoupdatePattern.bind(null, constants.AUTOUPDATE_PATTERN_NEVER),
|
2017-04-13 23:19:37 -07:00
|
|
|
settingsdb.set.bind(null, settings.APPSTORE_CONFIG_KEY, JSON.stringify({ userId: 'uid', cloudronId: 'cid', token: 'token' })),
|
2017-02-06 16:33:55 -08:00
|
|
|
mailer._clearMailQueue
|
2016-01-23 15:57:56 -08:00
|
|
|
], done);
|
|
|
|
|
});
|
|
|
|
|
|
2017-02-07 10:30:52 -08:00
|
|
|
after(cleanup);
|
2016-01-23 15:57:56 -08:00
|
|
|
|
2016-01-24 00:06:32 -08:00
|
|
|
it('no updates', function (done) {
|
2016-01-23 15:57:56 -08:00
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/boxupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token' })
|
|
|
|
|
.reply(204, { } );
|
2016-01-23 15:57:56 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkBoxUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
2016-01-24 00:06:32 -08:00
|
|
|
expect(updatechecker.getUpdateInfo().box).to.be(null);
|
2017-01-27 09:40:46 -08:00
|
|
|
expect(scope.isDone()).to.be.ok();
|
2016-04-12 13:15:40 -07:00
|
|
|
|
|
|
|
|
checkMails(0, done);
|
2016-01-24 00:06:32 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('new version', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/boxupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token' })
|
|
|
|
|
.reply(200, { version: '2.0.0', changelog: [''], sourceTarballUrl: '2.0.0.tar.gz' } );
|
2016-01-23 15:57:56 -08:00
|
|
|
|
2016-01-24 00:06:32 -08:00
|
|
|
updatechecker.checkBoxUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().box.version).to.be('2.0.0');
|
2017-04-13 23:19:37 -07:00
|
|
|
expect(updatechecker.getUpdateInfo().box.sourceTarballUrl).to.be('2.0.0.tar.gz');
|
2017-01-27 09:40:46 -08:00
|
|
|
expect(scope.isDone()).to.be.ok();
|
2016-04-12 13:15:40 -07:00
|
|
|
|
2017-01-27 08:07:59 -08:00
|
|
|
checkMails(1, done);
|
2016-01-24 00:06:32 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('does not offer prerelease', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/boxupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token' })
|
|
|
|
|
.reply(200, { version: '2.0.0-pre.0', changelog: [''], sourceTarballUrl: '2.0.0-pre.0.tar.gz' } );
|
2016-01-24 00:06:32 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkBoxUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().box).to.be(null);
|
2017-01-27 09:40:46 -08:00
|
|
|
expect(scope.isDone()).to.be.ok();
|
|
|
|
|
|
2016-04-12 13:24:23 -07:00
|
|
|
checkMails(0, done);
|
2016-01-24 00:06:32 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('offers prerelease', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
settings.setUpdateConfig({ prerelease: true }, function (error) {
|
|
|
|
|
if (error) return done(error);
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/boxupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token' })
|
|
|
|
|
.reply(200, { version: '2.0.0-pre.0', changelog: [''], sourceTarballUrl: '2.0.0-pre.0.tar.gz' } );
|
2016-01-24 00:06:32 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkBoxUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
2017-04-13 23:19:37 -07:00
|
|
|
expect(updatechecker.getUpdateInfo().box.version).to.be('2.0.0-pre.0');
|
2017-01-27 09:40:46 -08:00
|
|
|
expect(scope.isDone()).to.be.ok();
|
|
|
|
|
|
2017-01-27 08:07:59 -08:00
|
|
|
checkMails(1, done);
|
2016-01-24 00:06:32 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('bad response offers nothing', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/boxupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token' })
|
|
|
|
|
.reply(404, { version: '2.0.0-pre.0', changelog: [''], sourceTarballUrl: '2.0.0-pre.0.tar.gz' } );
|
2016-01-24 00:06:32 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkBoxUpdates(function (error) {
|
|
|
|
|
expect(error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().box).to.be(null);
|
2017-01-27 09:40:46 -08:00
|
|
|
expect(scope.isDone()).to.be.ok();
|
|
|
|
|
|
2016-04-12 13:24:23 -07:00
|
|
|
checkMails(0, done);
|
2016-01-24 00:06:32 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
2016-01-24 00:44:46 -08:00
|
|
|
|
2017-01-27 09:50:39 -08:00
|
|
|
describe('updatechecker - box - automatic', function () {
|
|
|
|
|
before(function (done) {
|
|
|
|
|
config.set('version', '1.0.0');
|
2017-04-14 01:13:42 -07:00
|
|
|
config.set('apiServerOrigin', 'http://localhost:4444');
|
2017-04-13 23:19:37 -07:00
|
|
|
config.set('provider', 'notcaas');
|
2017-01-27 09:50:39 -08:00
|
|
|
async.series([
|
|
|
|
|
database.initialize,
|
2017-02-07 10:30:52 -08:00
|
|
|
settings.initialize,
|
2017-01-27 09:50:39 -08:00
|
|
|
mailer._clearMailQueue,
|
2017-04-13 23:19:37 -07:00
|
|
|
user.createOwner.bind(null, USER_0.username, USER_0.password, USER_0.email, USER_0.displayName, AUDIT_SOURCE),
|
|
|
|
|
settingsdb.set.bind(null, settings.APPSTORE_CONFIG_KEY, JSON.stringify({ userId: 'uid', cloudronId: 'cid', token: 'token' }))
|
2017-01-27 09:50:39 -08:00
|
|
|
], done);
|
|
|
|
|
});
|
|
|
|
|
|
2017-02-07 10:30:52 -08:00
|
|
|
after(cleanup);
|
2017-01-27 09:50:39 -08:00
|
|
|
|
|
|
|
|
it('new version', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/boxupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token' })
|
|
|
|
|
.reply(200, { version: '2.0.0', sourceTarballUrl: '2.0.0.tar.gz' } );
|
2017-01-27 09:50:39 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkBoxUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().box.version).to.be('2.0.0');
|
|
|
|
|
expect(scope.isDone()).to.be.ok();
|
|
|
|
|
|
|
|
|
|
checkMails(0, done);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2017-04-13 23:19:37 -07:00
|
|
|
describe('updatechecker - app - manual (mails)', function () {
|
2016-01-24 00:44:46 -08:00
|
|
|
var APP_0 = {
|
|
|
|
|
id: 'appid-0',
|
|
|
|
|
appStoreId: 'io.cloudron.app',
|
|
|
|
|
installationState: appdb.ISTATE_PENDING_INSTALL,
|
|
|
|
|
installationProgress: null,
|
|
|
|
|
runState: null,
|
|
|
|
|
location: 'some-location-0',
|
|
|
|
|
manifest: {
|
|
|
|
|
version: '1.0.0', dockerImage: 'docker/app0', healthCheckPath: '/', httpPort: 80, title: 'app0',
|
|
|
|
|
tcpPorts: {
|
|
|
|
|
PORT: {
|
|
|
|
|
description: 'this is a port that i expose',
|
|
|
|
|
containerPort: '1234'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
httpPort: null,
|
|
|
|
|
containerId: null,
|
|
|
|
|
portBindings: { PORT: 5678 },
|
|
|
|
|
healthy: null,
|
|
|
|
|
accessRestriction: null,
|
2016-02-10 12:28:57 +01:00
|
|
|
memoryLimit: 0
|
2016-01-24 00:44:46 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
before(function (done) {
|
|
|
|
|
config.set('version', '1.0.0');
|
|
|
|
|
config.set('apiServerOrigin', 'http://localhost:4444');
|
2017-04-13 23:19:37 -07:00
|
|
|
config.set('provider', 'notcaas');
|
|
|
|
|
|
2016-01-24 00:44:46 -08:00
|
|
|
async.series([
|
|
|
|
|
database.initialize,
|
|
|
|
|
database._clear,
|
2017-02-07 10:30:52 -08:00
|
|
|
settings.initialize,
|
2016-04-12 13:13:16 -07:00
|
|
|
mailer._clearMailQueue,
|
2016-06-17 16:43:35 -05:00
|
|
|
appdb.add.bind(null, APP_0.id, APP_0.appStoreId, APP_0.manifest, APP_0.location, APP_0.portBindings, APP_0),
|
2017-01-27 09:40:46 -08:00
|
|
|
user.createOwner.bind(null, USER_0.username, USER_0.password, USER_0.email, USER_0.displayName, AUDIT_SOURCE),
|
2017-04-13 23:19:37 -07:00
|
|
|
settings.setAutoupdatePattern.bind(null, constants.AUTOUPDATE_PATTERN_NEVER),
|
|
|
|
|
settingsdb.set.bind(null, settings.APPSTORE_CONFIG_KEY, JSON.stringify({ userId: 'uid', cloudronId: 'cid', token: 'token' }))
|
2016-01-24 00:44:46 -08:00
|
|
|
], done);
|
|
|
|
|
});
|
|
|
|
|
|
2017-02-07 10:30:52 -08:00
|
|
|
after(cleanup);
|
2016-01-24 00:44:46 -08:00
|
|
|
|
|
|
|
|
it('no updates', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/appupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version })
|
|
|
|
|
.reply(204, { } );
|
2016-01-24 00:44:46 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkAppUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().apps).to.eql({});
|
2017-01-27 09:40:46 -08:00
|
|
|
expect(scope.isDone()).to.be.ok();
|
|
|
|
|
|
2016-04-12 13:24:23 -07:00
|
|
|
checkMails(0, done);
|
2016-01-24 00:44:46 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('bad response', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/appupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version })
|
2016-07-27 18:25:53 -07:00
|
|
|
.reply(500, { update: { manifest: { version: '1.0.0' } } } );
|
2016-01-24 00:44:46 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkAppUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().apps).to.eql({});
|
2017-01-27 09:40:46 -08:00
|
|
|
expect(scope.isDone()).to.be.ok();
|
|
|
|
|
|
2016-04-12 13:24:23 -07:00
|
|
|
checkMails(0, done);
|
2016-01-24 00:44:46 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('offers new version', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/appupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version })
|
|
|
|
|
.reply(200, { manifest: { version: '2.0.0' } } );
|
2016-01-24 00:44:46 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkAppUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().apps).to.eql({ 'appid-0': { manifest: { version: '2.0.0' } } });
|
2017-01-27 09:40:46 -08:00
|
|
|
expect(scope.isDone()).to.be.ok();
|
|
|
|
|
|
2016-04-12 13:24:23 -07:00
|
|
|
checkMails(1, done);
|
2016-01-24 00:44:46 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('does not offer old version', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
updatechecker.checkAppUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().apps).to.eql({ });
|
2016-04-12 13:24:23 -07:00
|
|
|
checkMails(0, done);
|
2016-01-24 00:44:46 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
2017-01-27 09:50:39 -08:00
|
|
|
|
2017-04-13 23:19:37 -07:00
|
|
|
describe('updatechecker - app - automatic (no emails)', function () {
|
2017-01-27 09:50:39 -08:00
|
|
|
var APP_0 = {
|
|
|
|
|
id: 'appid-0',
|
|
|
|
|
appStoreId: 'io.cloudron.app',
|
|
|
|
|
installationState: appdb.ISTATE_PENDING_INSTALL,
|
|
|
|
|
installationProgress: null,
|
|
|
|
|
runState: null,
|
|
|
|
|
location: 'some-location-0',
|
|
|
|
|
manifest: {
|
|
|
|
|
version: '1.0.0', dockerImage: 'docker/app0', healthCheckPath: '/', httpPort: 80, title: 'app0',
|
|
|
|
|
tcpPorts: {
|
|
|
|
|
PORT: {
|
|
|
|
|
description: 'this is a port that i expose',
|
|
|
|
|
containerPort: '1234'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
httpPort: null,
|
|
|
|
|
containerId: null,
|
|
|
|
|
portBindings: { PORT: 5678 },
|
|
|
|
|
healthy: null,
|
|
|
|
|
accessRestriction: null,
|
|
|
|
|
memoryLimit: 0
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
before(function (done) {
|
|
|
|
|
config.set('version', '1.0.0');
|
|
|
|
|
config.set('apiServerOrigin', 'http://localhost:4444');
|
2017-04-13 23:19:37 -07:00
|
|
|
config.set('provider', 'notcaas');
|
|
|
|
|
|
2017-01-27 09:50:39 -08:00
|
|
|
async.series([
|
|
|
|
|
database.initialize,
|
|
|
|
|
database._clear,
|
2017-02-07 10:30:52 -08:00
|
|
|
settings.initialize,
|
2017-01-27 09:50:39 -08:00
|
|
|
mailer._clearMailQueue,
|
|
|
|
|
appdb.add.bind(null, APP_0.id, APP_0.appStoreId, APP_0.manifest, APP_0.location, APP_0.portBindings, APP_0),
|
2017-04-13 23:19:37 -07:00
|
|
|
user.createOwner.bind(null, USER_0.username, USER_0.password, USER_0.email, USER_0.displayName, AUDIT_SOURCE),
|
|
|
|
|
settingsdb.set.bind(null, settings.APPSTORE_CONFIG_KEY, JSON.stringify({ userId: 'uid', cloudronId: 'cid', token: 'token' }))
|
2017-01-27 09:50:39 -08:00
|
|
|
], done);
|
|
|
|
|
});
|
|
|
|
|
|
2017-02-07 10:30:52 -08:00
|
|
|
after(cleanup);
|
2017-01-27 09:50:39 -08:00
|
|
|
|
|
|
|
|
it('offers new version', function (done) {
|
|
|
|
|
nock.cleanAll();
|
|
|
|
|
|
|
|
|
|
var scope = nock('http://localhost:4444')
|
2017-04-13 23:19:37 -07:00
|
|
|
.get('/api/v1/users/uid/cloudrons/cid/appupdate')
|
|
|
|
|
.query({ boxVersion: config.version(), accessToken: 'token', appId: APP_0.appStoreId, appVersion: APP_0.manifest.version })
|
|
|
|
|
.reply(200, { manifest: { version: '2.0.0' } } );
|
2017-01-27 09:50:39 -08:00
|
|
|
|
|
|
|
|
updatechecker.checkAppUpdates(function (error) {
|
|
|
|
|
expect(!error).to.be.ok();
|
|
|
|
|
expect(updatechecker.getUpdateInfo().apps).to.eql({ 'appid-0': { manifest: { version: '2.0.0' } } });
|
|
|
|
|
expect(scope.isDone()).to.be.ok();
|
|
|
|
|
|
|
|
|
|
checkMails(0, done);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|