Hide window when running in CI.

This commit is contained in:
Cheng Zhao 2013-08-21 11:35:39 +08:00
parent d160da7752
commit b411657b76
2 changed files with 12 additions and 10 deletions

View file

@ -8,6 +8,16 @@
<script type="text/javascript" charset="utf-8">
(function() {
// Check if we are running in CI.
var argv = require('remote').process.argv;
var isCi = argv[1] == '--ci';
if (!isCi) {
var win = require('remote').getCurrentWindow();
win.show();
win.focus();
}
// Show DevTools.
document.oncontextmenu = function(e) {
require('remote').getCurrentWindow().inspectElement(e.clientX, e.clientY);
@ -33,20 +43,12 @@
var Mocha = require('mocha');
var mocha = new Mocha();
mocha.ui('bdd').reporter('html');
mocha.ui('bdd').reporter(isCi ? 'tap' : 'html');
var query = Mocha.utils.parseQuery(window.location.search || '');
if (query.grep) mocha.grep(query.grep);
if (query.invert) mocha.invert();
// Check if we are running in CI.
var argv = require('remote').process.argv;
var isCi = false;
if (argv[1] == '--ci') {
isCi = true;
mocha.reporter('tap');
}
// Read all test files.
var walker = require('walkdir').walk(__dirname);

View file

@ -33,9 +33,9 @@ app.on('window-all-closed', function() {
app.on('finish-launching', function() {
window = new BrowserWindow({
title: 'atom-shell tests',
show: false,
width: 800,
height: 600
});
window.loadUrl('file://' + __dirname + '/index.html');
window.focus();
});