diff --git a/lib/cli/cli.js b/lib/cli/cli.js index b1b5354081..5a4c6b8d53 100755 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -42,7 +42,11 @@ exports.main = (argv = process.argv.slice(2), mochaArgs) => { module.paths.push(cwd(), path.resolve('node_modules')); } - Error.stackTraceLimit = Infinity; // configurable via --stack-trace-limit? + try { + Error.stackTraceLimit = Infinity; // configurable via --stack-trace-limit? + } catch (err) { + debug('unable to set Error.stackTraceLimit = Infinity', err); + } var args = mochaArgs || loadOptions(argv);