From da8ca46cc0be28a3d4690a4009e0ddec7fc6f779 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 29 Dec 2019 09:58:10 -0800 Subject: [PATCH] [Refactor] generalize error message from calling `.end` more than once --- lib/test.js | 2 +- test/double_end.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/test.js b/lib/test.js index 9ce1082c..b44388bf 100644 --- a/lib/test.js +++ b/lib/test.js @@ -151,7 +151,7 @@ Test.prototype.end = function (err) { } if (this.calledEnd) { - this.fail('.end() called twice'); + this.fail('.end() already called'); } this.calledEnd = true; this._end(); diff --git a/test/double_end.js b/test/double_end.js index ff4618b3..f254ed35 100644 --- a/test/double_end.js +++ b/test/double_end.js @@ -39,12 +39,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 ...]',