Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include name of test in log when test times out #524

Merged
merged 1 commit into from Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/test.js
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
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