fix(spec): remove unnecessary messages & prevent extra hot window

This commit is contained in:
Evan Morikawa 2016-09-28 14:51:48 -04:00
parent 0e98736f49
commit 68b3ab4225
7 changed files with 18 additions and 8 deletions

View file

@ -16,10 +16,6 @@ console.errorColor = function(err){
}
}
console.inspect = function(val) {
console.log(util.inspect(val, true, depth=7, colorize=true));
}
jasmine.NYLAS_ROOT_PATH = process.argv[3].split("NYLAS_ROOT_PATH=")[1]
jasmine.UNIT_TEST_TIMEOUT = 120*1000;
jasmine.BOOT_TIMEOUT = 30*1000;

View file

@ -61,6 +61,7 @@ export default class Application extends EventEmitter {
configDirPath: this.configDirPath,
config: this.config,
devMode: this.devMode,
specMode: this.specMode,
safeMode: this.safeMode,
initializeInBackground: initializeInBackground,
});

View file

@ -89,6 +89,7 @@ export default class AutoUpdateManager extends EventEmitter {
}
autoUpdater.on('error', (event, message) => {
if (this.specMode) return false;
console.error(`Error Downloading Update: ${message}`);
this.setState(ErrorState);
});

View file

@ -1,6 +1,11 @@
/* eslint dot-notation: 0 */
/* eslint global-require: 0 */
global.shellStartTime = Date.now();
var util = require('util')
console.inspect = function consoleInspect(val) {
console.log(util.inspect(val, true, depth=7, colorize=true));
}
const app = require('electron').app;
const path = require('path');

View file

@ -16,7 +16,7 @@ let winNum = 0;
export default class WindowLauncher {
static EMPTY_WINDOW = "emptyWindow"
constructor({devMode, safeMode, resourcePath, configDirPath, onCreatedHotWindow, config}) {
constructor({devMode, safeMode, specMode, resourcePath, configDirPath, onCreatedHotWindow, config}) {
this.defaultWindowOpts = {
frame: process.platform !== "darwin",
hidden: false,
@ -31,6 +31,7 @@ export default class WindowLauncher {
}
this.config = config;
this.onCreatedHotWindow = onCreatedHotWindow;
if (specMode) return;
this.createHotWindow();
}

View file

@ -9,7 +9,7 @@ const ONBOARDING_WINDOW = "onboarding"
export default class WindowManager {
constructor({devMode, safeMode, resourcePath, configDirPath, initializeInBackground, config}) {
constructor({devMode, safeMode, specMode, resourcePath, configDirPath, initializeInBackground, config}) {
this.initializeInBackground = initializeInBackground;
this._windows = {};
@ -17,7 +17,7 @@ export default class WindowManager {
this._registerWindow(win);
this._didCreateNewWindow(win);
}
this.windowLauncher = new WindowLauncher({devMode, safeMode, resourcePath, configDirPath, config, onCreatedHotWindow});
this.windowLauncher = new WindowLauncher({devMode, safeMode, specMode, resourcePath, configDirPath, config, onCreatedHotWindow});
}
get(windowKey) {

View file

@ -2,13 +2,19 @@ window.eval = global.eval = function() {
throw new Error("Sorry, N1 does not support window.eval() for security reasons.");
}
var util = require('util')
var path = require('path');
var electron = require('electron');
var remote = electron.remote;
console.inspect = function consoleInspect(val) {
console.log(util.inspect(val, true, depth=7, colorize=true));
}
function setLoadTime (loadTime) {
if (global.NylasEnv) {
global.NylasEnv.loadTime = loadTime
global.NylasEnv.loadTime = loadTime;
if (NylasEnv.inSpecMode()) return;
console.log('Window load time: ' + global.NylasEnv.getWindowLoadTime() + 'ms')
}
}