Add spec for get/setUploadToServer

This commit is contained in:
Kevin Sawicki 2016-11-28 15:01:38 -08:00
parent bb9876bd6e
commit f4be3782a2

View file

@ -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 = () => { const waitForCrashReport = () => {