fix windows tests

This commit is contained in:
Samuel Attard 2018-02-16 16:02:10 +11:00
parent 549042160f
commit a20b379f26
2 changed files with 27 additions and 23 deletions

View file

@ -19,12 +19,16 @@ class AutoUpdater extends EventEmitter {
setFeedURL (options) {
let updateURL
if (typeof options === 'string') {
if (typeof options === 'object') {
if (typeof options.url === 'string') {
updateURL = options.url
} else {
throw new Error('Expected options object to contain a \'url\' string property in setFeedUrl call')
}
} else if (typeof options === 'string') {
updateURL = options
} else if (typeof options === 'object' && typeof options.url === 'string') {
updateURL = options.url
} else {
throw new Error('Expected options.url to be a string but none was provided')
throw new Error('Expected an options object with a \'url\' property to be provided')
}
this.updateURL = updateURL
}