From: Kevin Sawicki Date: Wed, 16 Dec 2015 00:44:38 +0000 (-0800) Subject: Add specs for companyName/submitURL being required X-Git-Tag: v0.36.1~14^2~4 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=aedfd3bf0ebbf5de5bc03c83f54c9b8f98b28515;p=electron.git Add specs for companyName/submitURL being required --- diff --git a/atom/common/api/lib/deprecate.coffee b/atom/common/api/lib/deprecate.coffee index a7de9262..2481790c 100644 --- a/atom/common/api/lib/deprecate.coffee +++ b/atom/common/api/lib/deprecate.coffee @@ -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 diff --git a/spec/api-crash-reporter-spec.coffee b/spec/api-crash-reporter-spec.coffee index 789ba6e0..71b7d1db 100644 --- a/spec/api-crash-reporter-spec.coffee +++ b/spec/api-crash-reporter-spec.coffee @@ -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'})) diff --git a/spec/static/main.js b/spec/static/main.js index 4de12383..35ae544d 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -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');