Fix updatechecker tests

This commit is contained in:
Girish Ramakrishnan
2017-04-13 23:19:37 -07:00
parent 937931e885
commit 5e22caa6e7
2 changed files with 56 additions and 154 deletions

View File

@@ -96,8 +96,6 @@ function checkAppUpdates(callback) {
if (oldState[app.id] === newState[app.id]) {
debug('Skipping notification of app update %s since user was already notified', app.id);
} else if (semver.satisfies(newState[app.id], '~' + app.manifest.version)) {
debug('Skipping notification of app update as this is a patch release');
} else {
// only send notifications if update pattern is 'never'
settings.getAutoupdatePattern(function (error, result) {
@@ -150,23 +148,17 @@ function checkBoxUpdates(callback) {
return callback();
}
if (semver.satisfies(gBoxUpdateInfo.version, '~' + config.version())) {
debug('Skipping notification of box update as this is a patch release');
} else {
// only send notifications if update pattern is 'never'
settings.getAutoupdatePattern(function (error, result) {
if (error) return debug(error);
if (result !== constants.AUTOUPDATE_PATTERN_NEVER) return;
mailer.boxUpdateAvailable(updateInfo.version, updateInfo.changelog);
});
}
state.box = updateInfo.version;
saveState(state);
callback();
// only send notifications if update pattern is 'never'
settings.getAutoupdatePattern(function (error, result) {
if (error) debug(error);
else if (result === constants.AUTOUPDATE_PATTERN_NEVER) mailer.boxUpdateAvailable(updateInfo.version, updateInfo.changelog);
callback();
});
});
});
}