Add specs for companyName/submitURL being required

This commit is contained in:
Kevin Sawicki 2015-12-15 16:44:38 -08:00
parent 80e9631220
commit aedfd3bf0e
3 changed files with 12 additions and 3 deletions

View file

@ -52,7 +52,7 @@ deprecate.event = (emitter, oldName, newName, fn) ->
else
@emit oldName, args...
# Print deprecate warning.
# Print deprecation warning.
deprecate.warn = (oldName, newName) ->
deprecate.log("#{oldName} is deprecated. Use #{newName} instead.")
@ -65,5 +65,4 @@ deprecate.log = (message) ->
else
console.warn "(electron) #{message}"
module.exports = deprecate

View file

@ -55,5 +55,12 @@ describe 'crash-reporter module', ->
pathname: path.join fixtures, 'api', 'crash.html'
search: "?port=#{port}"
if process.platform is 'darwin'
crashReporter.start {'submitURL': 'http://127.0.0.1:' + port}
crashReporter.start
companyName: 'Umbrella Corporation'
submitURL: "http://127.0.0.1:#{port}"
w.loadURL url
describe ".start(options)", ->
it 'requires that the companyName and submitURL option fields be specified', ->
assert.throws(-> crashReporter.start({companyName: 'Missing submitURL'}))
assert.throws(-> crashReporter.start({submitURL: 'Missing companyName'}))

View file

@ -4,6 +4,9 @@ const ipcMain = electron.ipcMain;
const dialog = electron.dialog;
const BrowserWindow = electron.BrowserWindow;
// Disable use of deprecated functions.
process.throwDeprecation = true;
const path = require('path');
const url = require('url');