Add spec for remote autoUpdater error event
This commit is contained in:
		
					parent
					
						
							
								6c99d83b99
							
						
					
				
			
			
				commit
				
					
						423dd4d57a
					
				
			
		
					 1 changed files with 18 additions and 2 deletions
				
			
		|  | @ -1,6 +1,6 @@ | ||||||
| const assert = require('assert') | const assert = require('assert') | ||||||
| const autoUpdater = require('electron').remote.autoUpdater | const {autoUpdater} = require('electron').remote | ||||||
| const ipcRenderer = require('electron').ipcRenderer | const {ipcRenderer} = require('electron') | ||||||
| 
 | 
 | ||||||
| // Skip autoUpdater tests in MAS build.
 | // Skip autoUpdater tests in MAS build.
 | ||||||
| if (!process.mas) { | if (!process.mas) { | ||||||
|  | @ -64,5 +64,21 @@ if (!process.mas) { | ||||||
|         autoUpdater.quitAndInstall() |         autoUpdater.quitAndInstall() | ||||||
|       }) |       }) | ||||||
|     }) |     }) | ||||||
|  | 
 | ||||||
|  |     describe('error event', function () { | ||||||
|  |       it('serializes correctly over the remote module', function (done) { | ||||||
|  |         autoUpdater.once('error', function (error) { | ||||||
|  |           assert.equal(error instanceof Error, true) | ||||||
|  |           assert.deepEqual(Object.getOwnPropertyNames(error), ['stack', 'message', 'name']) | ||||||
|  |           done() | ||||||
|  |         }) | ||||||
|  | 
 | ||||||
|  |         autoUpdater.setFeedURL('') | ||||||
|  | 
 | ||||||
|  |         if (process.platform === 'win32') { | ||||||
|  |           autoUpdater.checkForUpdates() | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     }) | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kevin Sawicki
				Kevin Sawicki