Skip to content

Commit

Permalink
[New] Include name of test in log when test times out (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley authored and ljharb committed Aug 17, 2020
1 parent d0286f4 commit 78b4d98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/test.js
Expand Up @@ -136,7 +136,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 () {
Expand Down
4 changes: 2 additions & 2 deletions test/timeoutAfter.js
Expand Up @@ -12,11 +12,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 ...]',
' ...',
'',
Expand Down

0 comments on commit 78b4d98

Please sign in to comment.