Skip to content

Commit

Permalink
[Refactor] Test: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Mar 1, 2024
1 parent 6cd06f5 commit ce4ce8a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ function Test(name_, opts_, cb_) {
this._timeout = args.opts.timeout;
this._plan = undefined;
this._cb = args.cb;
this.ended = false;
this._progeny = [];
this._teardown = [];
this._ok = true;
this._objectPrintDepth = 5;
var depthEnvVar = process.env.NODE_TAPE_OBJECT_PRINT_DEPTH;
if (args.opts.objectPrintDepth) {
this._objectPrintDepth = args.opts.objectPrintDepth;
Expand All @@ -100,14 +102,11 @@ function Test(name_, opts_, cb_) {
} else {
this._objectPrintDepth = depthEnvVar;
}
} else {
this._objectPrintDepth = 5;
}

var self = this;
for (var prop in self) {
if (typeof self[prop] === 'function') {
self[prop] = callBind(self[prop], self);
for (var prop in this) {
if (typeof this[prop] === 'function') {
this[prop] = callBind(this[prop], this);
}
}
}
Expand Down

0 comments on commit ce4ce8a

Please sign in to comment.