mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
fix(spec): remove unnecessary messages & prevent extra hot window
This commit is contained in:
parent
0e98736f49
commit
68b3ab4225
4
spec_integration/jasmine/bootstrap.js
vendored
4
spec_integration/jasmine/bootstrap.js
vendored
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue