Comparing version 0.1.5 to 0.2.0
@@ -84,2 +84,5 @@ var Stream = require('stream'); | ||
} | ||
if (res.at) { | ||
output += inner + 'at: ' + res.at + '\n'; | ||
} | ||
if (res.operator === 'error' && res.actual && res.actual.stack) { | ||
@@ -86,0 +89,0 @@ var lines = String(res.actual.stack).split('\n'); |
var EventEmitter = require('events').EventEmitter; | ||
var deepEqual = require('deep-equal'); | ||
var defined = require('defined'); | ||
var path = require('path'); | ||
@@ -105,3 +106,3 @@ module.exports = Test; | ||
actual : defined(extra.actual, opts.actual), | ||
expected : defined(extra.expected, opts.expected) | ||
expected : defined(extra.expected, opts.expected), | ||
}; | ||
@@ -114,2 +115,25 @@ this._ok = Boolean(this._ok && ok); | ||
var e = new Error('exception'); | ||
var err = (e.stack || '').split('\n'); | ||
var dir = path.dirname(__dirname) + '/'; | ||
for (var i = 0; i < err.length; i++) { | ||
var m = /^\s*\bat\s+(.+)/.exec(err[i]); | ||
if (!m) continue; | ||
var s = m[1].split(/\s+/); | ||
var filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]); | ||
if (!filem) continue; | ||
if (filem[1].slice(0, dir.length) === dir) continue; | ||
res.functionName = s[0]; | ||
res.file = filem[1]; | ||
res.line = Number(filem[2]); | ||
if (filem[3]) res.column = filem[3]; | ||
res.at = m[1]; | ||
break; | ||
} | ||
self.emit('result', res); | ||
@@ -116,0 +140,0 @@ |
{ | ||
"name" : "tape", | ||
"version" : "0.1.5", | ||
"version" : "0.2.0", | ||
"description" : "tap-producing test harness for node and browsers", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47335
1377
175