我正在以编程方式运行使用mocha的测试,并且能够运行测试,使用下面的代码获得完整的标题,但是我无法找到在命令行上获得完整堆栈跟踪的任何方法。如何使用mocha作为库获得完整的堆栈跟踪。
mocha.run(function(failures){
if (failures) {
console.log('it failed');
} else {
console.log('it passed');
}
process.on('exit', function () {
process.exit(failures);
});
}).on('fail', function(test){
title = test.fullTitle();
}).on('pass', function(test){
title = test.fullTitle();
});发布于 2014-05-11 04:18:49
我可以用
var stackTrace = test.err.stack;https://stackoverflow.com/questions/23576564
复制相似问题