2015-11-20 07:29:49 +08:00
|
|
|
// argv[0] = node
|
|
|
|
// argv[1] = jasmine
|
2015-12-10 23:52:20 +08:00
|
|
|
// argv[2] = JASMINE_CONFIG_PATH=./jasmine/config.json
|
2015-11-20 07:29:49 +08:00
|
|
|
// argv[3] = NYLAS_ROOT_PATH=/path/to/nylas/root
|
2015-12-10 23:52:20 +08:00
|
|
|
var babelOptions = require('../../static/babelrc.json');
|
2016-05-04 03:37:32 +08:00
|
|
|
require('babel-register')(babelOptions);
|
2015-11-20 07:29:49 +08:00
|
|
|
|
2015-12-03 04:43:11 +08:00
|
|
|
var chalk = require('chalk')
|
|
|
|
var util = require('util')
|
|
|
|
|
|
|
|
console.errorColor = function(err){
|
|
|
|
if (typeof err === "string") {
|
|
|
|
console.error(chalk.red(err));
|
|
|
|
} else {
|
|
|
|
console.error(chalk.red(util.inspect(err)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 07:29:49 +08:00
|
|
|
jasmine.NYLAS_ROOT_PATH = process.argv[3].split("NYLAS_ROOT_PATH=")[1]
|
|
|
|
jasmine.UNIT_TEST_TIMEOUT = 120*1000;
|
|
|
|
jasmine.BOOT_TIMEOUT = 30*1000;
|
|
|
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30*1000
|
2015-12-03 04:43:11 +08:00
|
|
|
|
|
|
|
Promise = require('bluebird')
|
|
|
|
Promise.config({
|
|
|
|
warnings: true,
|
|
|
|
longStackTraces: true,
|
|
|
|
cancellation: true
|
|
|
|
})
|
|
|
|
|
|
|
|
process.on("unhandledRejection", function(reason, promise) {
|
|
|
|
if (reason.stack) { console.errorColor(reason.stack); }
|
|
|
|
console.errorColor(promise);
|
|
|
|
});
|
2016-02-04 07:06:52 +08:00
|
|
|
|
|
|
|
process.on("uncaughtException", function(error) {
|
|
|
|
if (error.stack) { console.errorColor(error.stack); }
|
|
|
|
console.errorColor(error);
|
|
|
|
});
|