Skip to content

Commit

Permalink
[New] Include name of test in log when test times out
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley authored and ljharb committed Aug 17, 2020
1 parent 975c192 commit e142c29
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions test/timeoutAfter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...]',
' ...',
'',
Expand Down

0 comments on commit e142c29

Please sign in to comment.