diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-05-02 22:01:05 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-05-02 22:01:05 +0200 |
commit | 20f1cf3dff685ead53c85a9cd751ae9dacea7289 (patch) | |
tree | e6b83ed38004e6df2f9008d2bfba0098f2523e6d | |
parent | c87060454ec8bbc89d7acdd5c7ef9006242a6930 (diff) | |
download | gitbook-20f1cf3dff685ead53c85a9cd751ae9dacea7289.zip gitbook-20f1cf3dff685ead53c85a9cd751ae9dacea7289.tar.gz gitbook-20f1cf3dff685ead53c85a9cd751ae9dacea7289.tar.bz2 |
Enable promise long stack trace when testing or debugging
-rw-r--r-- | lib/utils/promise.js | 5 | ||||
-rw-r--r-- | package.json | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/utils/promise.js b/lib/utils/promise.js index 19d7554..138546b 100644 --- a/lib/utils/promise.js +++ b/lib/utils/promise.js @@ -1,6 +1,11 @@ var Q = require('q'); var Immutable = require('immutable'); +// Debugging for long stack traces +if (global.__DEV__ || process.env.DEBUG) { + Q.longStackSupport = true; +} + /** Reduce an array to a promise diff --git a/package.json b/package.json index 6697aa5..40528bf 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,9 @@ ], "jest": { "automock": false, - "setupTestFrameworkScriptFile": "<rootDir>/jest/customMatchers.js" + "setupTestFrameworkScriptFile": "<rootDir>/jest/customMatchers.js", + "globals": { + "__DEV__": true + } } } |