From: Kevin Sawicki Date: Thu, 10 Dec 2015 18:33:18 +0000 (-0800) Subject: Parse spec arguments using yargs library X-Git-Tag: v0.36.0~1^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a42fa5d5c2b3b71a3f589bdf254ac25fe4885d70;p=electron.git Parse spec arguments using yargs library --- diff --git a/spec/api-browser-window-spec.coffee b/spec/api-browser-window-spec.coffee index 86beb1fd..38c82170 100644 --- a/spec/api-browser-window-spec.coffee +++ b/spec/api-browser-window-spec.coffee @@ -8,7 +8,7 @@ os = require 'os' {remote, screen} = require 'electron' {ipcMain, BrowserWindow} = remote.require 'electron' -isCI = remote.process.argv[2] == '--ci' +isCI = remote.getGlobal('isCi') describe 'browser-window module', -> fixtures = path.resolve __dirname, 'fixtures' diff --git a/spec/api-crash-reporter-spec.coffee b/spec/api-crash-reporter-spec.coffee index 676dbf9d..789ba6e0 100644 --- a/spec/api-crash-reporter-spec.coffee +++ b/spec/api-crash-reporter-spec.coffee @@ -18,7 +18,7 @@ describe 'crash-reporter module', -> return if process.mas # The crash-reporter test is not reliable on CI machine. - isCI = remote.process.argv[2] == '--ci' + isCI = remote.getGlobal('isCi') return if isCI it 'should send minidump when renderer crashes', (done) -> diff --git a/spec/package.json b/spec/package.json index 38bd8379..79e7d954 100644 --- a/spec/package.json +++ b/spec/package.json @@ -5,13 +5,14 @@ "version": "0.1.0", "devDependencies": { "basic-auth": "^1.0.0", - "multiparty": "4.1.2", "graceful-fs": "3.0.5", "mocha": "2.1.0", + "multiparty": "4.1.2", "q": "0.9.7", "temp": "0.8.1", "walkdir": "0.0.7", - "ws": "0.7.2" + "ws": "0.7.2", + "yargs": "^3.31.0" }, "optionalDependencies": { "ffi": "2.0.0", diff --git a/spec/static/index.html b/spec/static/index.html index ea86f6ee..f958e1b7 100644 --- a/spec/static/index.html +++ b/spec/static/index.html @@ -18,8 +18,7 @@ var remote = electron.remote; var ipcRenderer = electron.ipcRenderer; - var argv = remote.process.argv; - var isCi = argv[2] == '--ci'; + var isCi = remote.getGlobal('isCi') if (!isCi) { var win = remote.getCurrentWindow(); diff --git a/spec/static/main.js b/spec/static/main.js index be3690cd..2a637274 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -42,7 +42,8 @@ ipcMain.on('echo', function(event, msg) { event.returnValue = msg; }); -if (process.argv[2] == '--ci') { +global.isCi = !!argv.ci; +if (global.isCi) { process.removeAllListeners('uncaughtException'); process.on('uncaughtException', function(error) { console.error(error, error.stack);