Skip to content

Commit

Permalink
[Refactor] generalize error message from calling .end more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 29, 2019
1 parent bd76254 commit 8e8af01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Test.prototype.end = function (err) {
}

if (this.calledEnd) {
this.fail('.end() called twice');
this.fail('.end() already called');
}
this.calledEnd = true;
this._end();
Expand Down
4 changes: 2 additions & 2 deletions test/async-await.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ tap.test('async5', function (t) {
'ok 5 res.statusCode is 200',
'ok 6 mockDb.state is new',
'ok 7 error on close',
'not ok 8 .end() called twice',
'not ok 8 .end() already called',
' ---',
' operator: fail',
' at: Server.<anonymous> ($TEST/async-await/async5.js:$LINE:$COL)',
' stack: |-',
' Error: .end() called twice',
' Error: .end() already called',
' [... stack stripped ...]',
' at Server.<anonymous> ($TEST/async-await/async5.js:$LINE:$COL)',
' [... stack stripped ...]',
Expand Down
4 changes: 2 additions & 2 deletions test/double_end.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ test(function (t) {
'TAP version 13',
'# double end',
'ok 1 should be equal',
'not ok 2 .end() called twice',
'not ok 2 .end() already called',
' ---',
' operator: fail',
' ' + atExpected,
' stack: |-',
' Error: .end() called twice',
' Error: .end() already called',
' [... stack stripped ...]',
' ' + stackExpected,
' [... stack stripped ...]',
Expand Down

0 comments on commit 8e8af01

Please sign in to comment.