Add line numbers to failures when unit testing in Firefox. Closes #9231.
This commit is contained in:
parent
e75cd0acdd
commit
f3d9cb2579
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Add line numbers to failures when unit testing in Firefox. Closes #9231. [John Resig]
|
||||
|
||||
* Fix Function#argumentNames for Opera and IE. [Thomas Fuchs]
|
||||
|
||||
* Add Object.isString, Object.isNumber, and Object.isUndefined, and clean up the source to make use of Object.isXXX where possible. [sam]
|
||||
|
|
|
@ -277,7 +277,15 @@ Test.Unit.Assertions.prototype = {
|
|||
},
|
||||
fail: function(message) {
|
||||
this.failures++;
|
||||
this.messages.push("Failure: " + message);
|
||||
|
||||
var line = "";
|
||||
try {
|
||||
throw new Error("stack");
|
||||
} catch(e){
|
||||
line = (/\.html:(\d+)/.exec(e.stack || '') || ['',''])[1];
|
||||
}
|
||||
|
||||
this.messages.push("Failure: " + message + (line ? " Line #" + line : ""));
|
||||
},
|
||||
info: function(message) {
|
||||
this.messages.push("Info: " + message);
|
||||
|
|
Loading…
Reference in New Issue