提交 f4bc1c09 编写于 作者: A Alex Dima

Improve handling of unexpected errors in tests

上级 94545eee
......@@ -155,11 +155,12 @@ function loadTests(opts) {
// collect unexpected errors
loader.require(['vs/base/common/errors'], function (errors) {
errors.setUnexpectedErrorHandler(function (err) {
try {
throw new Error('oops');
} catch (e) {
_unexpectedErrors.push((err && err.message ? err.message : err) + '\n' + e.stack);
let stack = (err ? err.stack : null);
if (!stack) {
stack = new Error().stack;
}
_unexpectedErrors.push((err && err.message ? err.message : err) + '\n' + stack);
});
});
......@@ -172,7 +173,7 @@ function loadTests(opts) {
console.error('');
console.error(stack);
});
assert.ok(false);
assert.ok(false, errors);
}
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册