Skip to content

Commit

Permalink
Fix Test constructor so that it doesn't accidentally mutate global scope
Browse files Browse the repository at this point in the history
As used by Test.skip itself circa lib/test.js:464
  • Loading branch information
Joshua T Corbin authored and James Halliday committed May 14, 2014
1 parent 1ca29e2 commit ba3bcbb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ var getTestArgs = function (name_, opts_, cb_) {
};

function Test (name_, opts_, cb_) {
if (! (this instanceof Test)) {
return new Test(name_, opts_, cb_);
}

var args = getTestArgs(name_, opts_, cb_);

this.readable = true;
Expand Down

0 comments on commit ba3bcbb

Please sign in to comment.