From 69c0a33c859a0c0424b593c7c203e1a48d53eadc Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 10 Dec 2015 10:33:43 -0800 Subject: [PATCH] Pass mocha grep command line option through to spec app --- spec/static/main.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/spec/static/main.js b/spec/static/main.js index 2a637274..e83e79c1 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -5,6 +5,12 @@ const dialog = electron.dialog; const BrowserWindow = electron.BrowserWindow; const path = require('path'); +const url = require('url'); + +var argv = require('yargs') + .boolean('ci') + .string('g').alias('g', 'grep') + .argv; var window = null; process.port = 0; // will be used by crash-reporter spec. @@ -68,7 +74,13 @@ app.on('ready', function() { javascript: true // Test whether web-preferences crashes. }, }); - window.loadURL('file://' + __dirname + '/index.html'); + window.loadURL(url.format({ + pathname: __dirname + '/index.html', + protocol: 'file', + query: { + grep: argv.grep + } + })); window.on('unresponsive', function() { var chosen = dialog.showMessageBox(window, { type: 'warning', -- 2.43.0