Patch assert messages without `message: ` format

pull/4884/head
Berkeley Martinez 2015-12-01 23:24:03 -08:00
parent 636824aba3
commit 8cad219082
1 changed files with 9 additions and 5 deletions

View File

@ -51,11 +51,15 @@ window.$(document).ready(function() {
} catch (e) {
userTest.err = e.message.split(':').shift();
} finally {
userTest.text = test
.split(',')
.pop()
.replace(/\'/g, '')
.replace(/\)/, '');
if (!test.match(/message: /g)) {
userTest.text = 'message: ' + test
.split(',')
.pop()
.replace(/\'/g, '')
.replace(/\)/, '');
} else {
userTest.text = test;
}
}
return userTest;
})