From d00aa7e8dc38901ea4f06a553b5030745f3a3755 Mon Sep 17 00:00:00 2001 From: Juan Soto Date: Tue, 23 Feb 2016 15:32:04 -0500 Subject: [PATCH] Fix failed line missing from TAP output --- lib/reporters/tap.js | 4 ++-- test/reporters/tap.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/reporters/tap.js b/lib/reporters/tap.js index af5a79d..22df2c3 100644 --- a/lib/reporters/tap.js +++ b/lib/reporters/tap.js @@ -7,7 +7,7 @@ function getSourceFromStack(stack, index) { .split('\n') .slice(index, index + 1) .join('') - .replace(/^\s+at /, ''); + .replace(/^\s+ /, ''); } function TapReporter() { @@ -35,7 +35,7 @@ TapReporter.prototype.test = function (test) { ' operator: ' + test.error.operator, ' expected: ' + test.error.expected, ' actual: ' + test.error.actual, - ' at: ' + getSourceFromStack(test.error.stack, 3), + ' at: ' + getSourceFromStack(test.error.stack, 1), ' ...' ]; } else { diff --git a/test/reporters/tap.js b/test/reporters/tap.js index 8d7f571..0d3c3b7 100644 --- a/test/reporters/tap.js +++ b/test/reporters/tap.js @@ -35,7 +35,7 @@ test('failing test', function (t) { operator: '==', expected: true, actual: false, - stack: ['', '', '', ' at Test.fn (test.js:1:2)'].join('\n') + stack: ['', 'Test.fn (test.js:1:2)'].join('\n') } }); @@ -60,7 +60,7 @@ test('unhandled error', function (t) { var actualOutput = reporter.unhandledError({ message: 'unhandled', name: 'TypeError', - stack: ['', ' at Test.fn (test.js:1:2)'].join('\n') + stack: ['', 'Test.fn (test.js:1:2)'].join('\n') }); var expectedOutput = [