Better stack traces in tests and production.
This commit is contained in:
parent
464cfe701c
commit
6b92f30324
3
.mocha.opts
Normal file
3
.mocha.opts
Normal file
@ -0,0 +1,3 @@
|
||||
--require clarify
|
||||
--require trace
|
||||
--require source-map-support/register
|
6
index.js
6
index.js
@ -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')
|
||||
|
@ -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": [
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user