Better stack traces in tests and production.

This commit is contained in:
Julien Fontanet 2015-06-09 15:55:48 +02:00
parent 464cfe701c
commit 6b92f30324
4 changed files with 12 additions and 6 deletions

3
.mocha.opts Normal file
View File

@ -0,0 +1,3 @@
--require clarify
--require trace
--require source-map-support/register

View File

@ -7,8 +7,10 @@ if (process.env.DEBUG === undefined) {
process.env.DEBUG = 'app-conf,xen-api,xo:*'
}
// Enable source maps support for traces.
require('source-map-support').install()
// Better stack traces.
require('clarify')
require('source-map-support/register')
require('trace')
// Import the real main module.
module.exports = require('./dist')

View File

@ -57,6 +57,7 @@
"lodash.foreach": "^3.0.1",
"lodash.has": "^3.0.0",
"lodash.includes": "^3.1.1",
"clarify": "^1.0.5",
"lodash.isarray": "^3.0.0",
"lodash.isempty": "^3.0.0",
"lodash.isfunction": "^3.0.1",
@ -76,7 +77,9 @@
"schema-inspector": "^1.5.1",
"serve-static": "^1.9.2",
"source-map-support": "^0.3.1",
"source-map-support": "^0.3.1",
"then-redis": "~1.3.0",
"trace": "^1.2.0",
"ws": "~0.7.1",
"xen-api": "^0.5.4",
"xml2js": "~0.4.6",
@ -104,7 +107,7 @@
"lint": "standard",
"prepublish": "in-publish && npm run build || in-install",
"start": "node bin/xo-server",
"test": "mocha 'dist/**/*.spec.js'"
"test": "mocha --opts .mocha.opts 'dist/**/*.spec.js'"
},
"standard": {
"ignore": [

View File

@ -1,13 +1,11 @@
import createLogger from 'debug'
const debug = createLogger('xo:main')
import Bluebird from 'bluebird'
Bluebird.longStackTraces()
import appConf from 'app-conf'
import assign from 'lodash.assign'
import bind from 'lodash.bind'
import blocked from 'blocked'
import Bluebird from 'bluebird'
import createConnectApp from 'connect'
import eventToPromise from 'event-to-promise'
import forEach from 'lodash.foreach'