]> khamidou — GitHub mirrors - electron.git/commitdiff
Pass mocha grep command line option through to spec app
authorKevin Sawicki <kevinsawicki@gmail.com>
Thu, 10 Dec 2015 18:33:43 +0000 (10:33 -0800)
committerKevin Sawicki <kevinsawicki@gmail.com>
Thu, 10 Dec 2015 18:33:43 +0000 (10:33 -0800)
spec/static/main.js

index 2a637274a25fe95babe8f2091af10751141c1af1..e83e79c1934bd85cf9805e42618ad60fcaadb353 100644 (file)
@@ -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',