Skip to content

Commit da0cdf1

Browse files
committedJul 24, 2021
[Refactor] remove unused line, unneeded var initialization; add missing new
1 parent a04439c commit da0cdf1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
 

‎lib/test.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ Test.prototype.timeoutAfter = function (ms) {
146146
});
147147
};
148148

149-
Test.prototype.end = function (err) {
150-
var self = this;
149+
Test.prototype.end = function end(err) {
151150
if (arguments.length >= 1 && !!err) {
152151
this.ifError(err);
153152
}
@@ -493,7 +492,7 @@ Test.prototype['throws'] = function (fn, expected, msg, extra) {
493492
expected = undefined;
494493
}
495494

496-
var caught = undefined;
495+
var caught;
497496

498497
try {
499498
fn();
@@ -532,11 +531,10 @@ Test.prototype.doesNotThrow = function (fn, expected, msg, extra) {
532531
msg = expected;
533532
expected = undefined;
534533
}
535-
var caught = undefined;
534+
var caught;
536535
try {
537536
fn();
538-
}
539-
catch (err) {
537+
} catch (err) {
540538
caught = { error: err };
541539
}
542540
this._assert(!caught, {
@@ -595,7 +593,7 @@ Test.prototype.doesNotMatch = function doesNotMatch(string, regexp, msg, extra)
595593
Test.skip = function (name_, _opts, _cb) {
596594
var args = getTestArgs.apply(null, arguments);
597595
args.opts.skip = true;
598-
return Test(args.name, args.opts, args.cb);
596+
return new Test(args.name, args.opts, args.cb);
599597
};
600598

601599
// vim: set softtabstop=4 shiftwidth=4:

0 commit comments

Comments
 (0)
Please sign in to comment.