unexpected
Version:
Extensible BDD assertion toolkit
19 lines (17 loc) • 464 B
JavaScript
/*global window*/
const Promise = require('unexpected-bluebird');
let useFullStackTrace = false;
if (typeof window !== 'undefined' && typeof window.location !== 'undefined') {
useFullStackTrace = !!window.location.search.match(
/[?&]full-trace=true(?:$|&)/
);
}
if (
typeof process !== 'undefined' &&
process.env &&
process.env.UNEXPECTED_FULL_TRACE
) {
Promise.longStackTraces();
useFullStackTrace = true;
}
module.exports = useFullStackTrace;