]> khamidou — GitHub mirrors - electron.git/commitdiff
Add specs for companyName/submitURL being required
authorKevin Sawicki <kevinsawicki@gmail.com>
Wed, 16 Dec 2015 00:44:38 +0000 (16:44 -0800)
committerKevin Sawicki <kevinsawicki@gmail.com>
Wed, 16 Dec 2015 00:44:38 +0000 (16:44 -0800)
atom/common/api/lib/deprecate.coffee
spec/api-crash-reporter-spec.coffee
spec/static/main.js

index a7de92626259694ee4d04c3dc169ecd93742c865..2481790cf816cb707fde6d16ce4f61002a873b62 100644 (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
index 789ba6e01f59702a545dba1423cf8fc93ac1abaa..71b7d1dbc924fb135792a4d55115eada02a2b070 100644 (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'}))
index 4de123830ee41e6044ea765d54b11c24c710276d..35ae544dcdd487c982271e6d4fd9dab6e1de9fc3 100644 (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');