Add spec for get/setUploadToServer
This commit is contained in:
parent
bb9876bd6e
commit
f4be3782a2
1 changed files with 21 additions and 0 deletions
|
@ -117,6 +117,27 @@ describe('crashReporter module', function () {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('.get/setUploadToServer', function () {
|
||||
it('throws an error when called from the renderer process', function () {
|
||||
assert.throws(() => require('electron').crashReporter.getUploadToServer())
|
||||
})
|
||||
|
||||
it('can be read/set from the main process', function () {
|
||||
if (process.platform === 'darwin') {
|
||||
crashReporter.start({
|
||||
companyName: 'Umbrella Corporation',
|
||||
submitURL: 'http://127.0.0.1/crashes',
|
||||
autoSubmit: true
|
||||
})
|
||||
assert.equal(crashReporter.getUploadToServer(), true)
|
||||
crashReporter.setUploadToServer(false)
|
||||
assert.equal(crashReporter.getUploadToServer(), false)
|
||||
} else {
|
||||
assert.equal(crashReporter.getUploadToServer(), false)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const waitForCrashReport = () => {
|
||||
|
|
Loading…
Reference in a new issue