From e142c298e8c76c49954ede50ab59e3f2e5662d77 Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Mon, 17 Aug 2020 15:23:00 -0700 Subject: [PATCH] [New] Include name of test in log when test times out --- lib/test.js | 2 +- test/timeoutAfter.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/test.js b/lib/test.js index 2ea55df8..4d6182c0 100644 --- a/lib/test.js +++ b/lib/test.js @@ -159,7 +159,7 @@ Test.prototype.timeoutAfter = function (ms) { if (!ms) throw new Error('timeoutAfter requires a timespan'); var self = this; var timeout = safeSetTimeout(function () { - self.fail('test timed out after ' + ms + 'ms'); + self.fail(self.name + ' timed out after ' + ms + 'ms'); self.end(); }, ms); this.once('end', function () { diff --git a/test/timeoutAfter.js b/test/timeoutAfter.js index 1f188da6..eab18702 100644 --- a/test/timeoutAfter.js +++ b/test/timeoutAfter.js @@ -14,11 +14,11 @@ tap.test('timeoutAfter test', function (tt) { tt.same(stripFullStack(rows.toString('utf8')), [ 'TAP version 13', '# timeoutAfter', - 'not ok 1 test timed out after 1ms', + 'not ok 1 timeoutAfter timed out after 1ms', ' ---', ' operator: fail', ' stack: |-', - ' Error: test timed out after 1ms', + ' Error: timeoutAfter timed out after 1ms', ' [... stack stripped ...]', ' ...', '',