|
|
@ -1,5 +1,6 @@ |
|
|
|
'use strict'; |
|
|
|
var format = require('util').format; |
|
|
|
var stripAnsi = require('strip-ansi'); |
|
|
|
|
|
|
|
// Parses stack trace and extracts original function name, file name and line.
|
|
|
|
function getSourceFromStack(stack, index) { |
|
|
@ -36,10 +37,12 @@ TapReporter.prototype.test = function (test) { |
|
|
|
directive = '# SKIP'; |
|
|
|
} |
|
|
|
|
|
|
|
var title = stripAnsi(test.title); |
|
|
|
|
|
|
|
if (test.error) { |
|
|
|
output = [ |
|
|
|
'# ' + test.title, |
|
|
|
format('not ok %d - %s', ++this.i, test.title), |
|
|
|
'# ' + title, |
|
|
|
format('not ok %d - %s', ++this.i, title), |
|
|
|
' ---', |
|
|
|
' operator: ' + test.error.operator, |
|
|
|
' expected: ' + test.error.expected, |
|
|
@ -49,8 +52,8 @@ TapReporter.prototype.test = function (test) { |
|
|
|
]; |
|
|
|
} else { |
|
|
|
output = [ |
|
|
|
'# ' + test.title, |
|
|
|
format('%s %d - %s %s', passed, ++this.i, test.title, directive).trim() |
|
|
|
'# ' + title, |
|
|
|
format('%s %d - %s %s', passed, ++this.i, title, directive).trim() |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|