Skip to content

Commit da45ae6

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

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
 

‎lib/test.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ Test.prototype.timeoutAfter = function timeoutAfter(ms) {
179179
};
180180

181181
Test.prototype.end = function end(err) {
182-
var self = this;
183182
if (arguments.length >= 1 && !!err) {
184183
this.ifError(err);
185184
}
@@ -211,7 +210,6 @@ Test.prototype._end = function _end(err) {
211210
return;
212211
}
213212

214-
215213
function next() {
216214
if (self._teardown.length === 0) {
217215
completeEnd();
@@ -616,7 +614,7 @@ Test.prototype['throws'] = function (fn, expected, msg, extra) {
616614
expected = undefined;
617615
}
618616

619-
var caught = undefined;
617+
var caught;
620618

621619
try {
622620
fn();
@@ -681,11 +679,10 @@ Test.prototype.doesNotThrow = function doesNotThrow(fn, expected, msg, extra) {
681679
msg = expected;
682680
expected = undefined;
683681
}
684-
var caught = undefined;
682+
var caught;
685683
try {
686684
fn();
687-
}
688-
catch (err) {
685+
} catch (err) {
689686
caught = { error: err };
690687
}
691688
this._assert(!caught, {
@@ -744,7 +741,7 @@ Test.prototype.doesNotMatch = function doesNotMatch(string, regexp, msg, extra)
744741
Test.skip = function skip(name_, _opts, _cb) {
745742
var args = getTestArgs.apply(null, arguments);
746743
args.opts.skip = true;
747-
return Test(args.name, args.opts, args.cb);
744+
return new Test(args.name, args.opts, args.cb);
748745
};
749746

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

0 commit comments

Comments
 (0)
Please sign in to comment.