fix: use test text instead of err message

pull/25153/head^2
Valeriy S 2018-12-04 17:25:11 +03:00 committed by Stuart Taylor
parent 8a6611db3a
commit 181fcb9b32
1 changed files with 5 additions and 8 deletions

View File

@ -109,15 +109,12 @@ document.addEventListener('DOMContentLoaded', function() {
const { message, stack } = err;
// we catch the error here to prevent the error from bubbling up
// and collapsing the pipe
let errMessage = message.slice(0) || '';
const assertIndex = errMessage.indexOf(': expected');
if (assertIndex !== -1) {
errMessage = errMessage.slice(0, assertIndex);
}
errMessage = errMessage.replace(/<code>(.*?)<\/code>/g, '$1');
newTest.err = errMessage + '\n' + stack;
newTest.err = message + '\n' + stack;
newTest.stack = stack;
newTest.message = errMessage;
newTest.message = text.replace(/<code>(.*?)<\/code>/g, '$1');
if (!(err instanceof chai.AssertionError)) {
console.error(err);
}
// RxJS catch expects an observable as a return
return of(newTest);
})