Clear Update.exe login item settings in afterEach
This commit is contained in:
parent
3c2539eced
commit
1c6a07c68d
1 changed files with 8 additions and 9 deletions
|
@ -313,12 +313,20 @@ describe('app module', function () {
|
|||
describe('app.get/setLoginItemSettings API', function () {
|
||||
if (process.platform === 'linux') return
|
||||
|
||||
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe')
|
||||
const processStartArgs = [
|
||||
'--processStart', `"${path.basename(process.execPath)}"`,
|
||||
'--process-start-args', `"--hidden"`
|
||||
]
|
||||
|
||||
beforeEach(function () {
|
||||
app.setLoginItemSettings({openAtLogin: false})
|
||||
app.setLoginItemSettings({openAtLogin: false, path: updateExe, args: processStartArgs})
|
||||
})
|
||||
|
||||
afterEach(function () {
|
||||
app.setLoginItemSettings({openAtLogin: false})
|
||||
app.setLoginItemSettings({openAtLogin: false, path: updateExe, args: processStartArgs})
|
||||
})
|
||||
|
||||
it('returns the login item status of the app', function () {
|
||||
|
@ -353,15 +361,6 @@ describe('app module', function () {
|
|||
it('allows you to pass a custom executable and arguments', () => {
|
||||
if (process.platform !== 'win32') return
|
||||
|
||||
const appFolder = path.dirname(process.execPath)
|
||||
const updateExe = path.resolve(appFolder, '..', 'Update.exe')
|
||||
const exeName = path.basename(process.execPath)
|
||||
|
||||
const processStartArgs = [
|
||||
'--processStart', `"${exeName}"`,
|
||||
'--process-start-args', `"--hidden"`
|
||||
]
|
||||
|
||||
app.setLoginItemSettings({openAtLogin: true, path: updateExe, args: processStartArgs})
|
||||
|
||||
assert.equal(app.getLoginItemSettings().openAtLogin, false)
|
||||
|
|
Loading…
Reference in a new issue