Skip to content

Commit

Permalink
[Refactor] remove unused line, unneeded var initialization; add missi…
Browse files Browse the repository at this point in the history
…ng `new`
  • Loading branch information
ljharb committed Jul 24, 2021
1 parent a04439c commit da0cdf1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/test.js
Expand Up @@ -146,8 +146,7 @@ Test.prototype.timeoutAfter = function (ms) {
});
};

Test.prototype.end = function (err) {
var self = this;
Test.prototype.end = function end(err) {
if (arguments.length >= 1 && !!err) {
this.ifError(err);
}
Expand Down Expand Up @@ -493,7 +492,7 @@ Test.prototype['throws'] = function (fn, expected, msg, extra) {
expected = undefined;
}

var caught = undefined;
var caught;

try {
fn();
Expand Down Expand Up @@ -532,11 +531,10 @@ Test.prototype.doesNotThrow = function (fn, expected, msg, extra) {
msg = expected;
expected = undefined;
}
var caught = undefined;
var caught;
try {
fn();
}
catch (err) {
} catch (err) {
caught = { error: err };
}
this._assert(!caught, {
Expand Down Expand Up @@ -595,7 +593,7 @@ Test.prototype.doesNotMatch = function doesNotMatch(string, regexp, msg, extra)
Test.skip = function (name_, _opts, _cb) {
var args = getTestArgs.apply(null, arguments);
args.opts.skip = true;
return Test(args.name, args.opts, args.cb);
return new Test(args.name, args.opts, args.cb);
};

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

0 comments on commit da0cdf1

Please sign in to comment.