wrap conditional, because return can only be used in a function
This commit is contained in:
parent
3855a774ab
commit
bd9b0b8ed3
1 changed files with 32 additions and 33 deletions
|
@ -1,38 +1,37 @@
|
||||||
const assert = require('assert');
|
const assert = require('assert')
|
||||||
const autoUpdater = require('electron').remote.autoUpdater;
|
const autoUpdater = require('electron').remote.autoUpdater
|
||||||
const ipcRenderer = require('electron').ipcRenderer;
|
const ipcRenderer = require('electron').ipcRenderer
|
||||||
|
|
||||||
// Skip autoUpdater tests in MAS build.
|
// Skip autoUpdater tests in MAS build.
|
||||||
if (process.mas)
|
if (!process.mas) {
|
||||||
return;
|
describe('autoUpdater module', function () {
|
||||||
|
describe('checkForUpdates', function () {
|
||||||
|
it('emits an error on Windows when called the feed URL is not set', function (done) {
|
||||||
|
if (process.platform !== 'win32') {
|
||||||
|
return done()
|
||||||
|
}
|
||||||
|
|
||||||
describe('autoUpdater module', function() {
|
ipcRenderer.once('auto-updater-error', function (event, message) {
|
||||||
describe('checkForUpdates', function() {
|
assert.equal(message, 'Update URL is not set')
|
||||||
it('emits an error on Windows when called the feed URL is not set', function (done) {
|
done()
|
||||||
if (process.platform !== 'win32') {
|
})
|
||||||
return done();
|
autoUpdater.setFeedURL('')
|
||||||
}
|
autoUpdater.checkForUpdates()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
ipcRenderer.once('auto-updater-error', function(event, message) {
|
describe('setFeedURL', function () {
|
||||||
assert.equal(message, 'Update URL is not set');
|
it('emits an error on Mac OS X when the application is unsigned', function (done) {
|
||||||
done();
|
if (process.platform !== 'darwin') {
|
||||||
});
|
return done()
|
||||||
autoUpdater.setFeedURL('');
|
}
|
||||||
autoUpdater.checkForUpdates();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('setFeedURL', function() {
|
ipcRenderer.once('auto-updater-error', function (event, message) {
|
||||||
it('emits an error on Mac OS X when the application is unsigned', function (done) {
|
assert.equal(message, 'Could not get code signature for running application')
|
||||||
if (process.platform !== 'darwin') {
|
done()
|
||||||
return done();
|
})
|
||||||
}
|
autoUpdater.setFeedURL('')
|
||||||
|
})
|
||||||
ipcRenderer.once('auto-updater-error', function(event, message) {
|
})
|
||||||
assert.equal(message, 'Could not get code signature for running application');
|
})
|
||||||
done();
|
}
|
||||||
});
|
|
||||||
autoUpdater.setFeedURL('');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue