Skip to content

Commit

Permalink
Excl docs in coverage + clamp in suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaub committed May 6, 2020
1 parent 5abd67d commit f2e1b2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .nycrc
Expand Up @@ -5,6 +5,7 @@
],
"exclude": [
"coverage/**",
"docs/**",
"packages/*/test{,s}/**",
"**/*.d.ts",
"test{,s}/**",
Expand Down
6 changes: 6 additions & 0 deletions lib/suite.js
Expand Up @@ -124,6 +124,12 @@ Suite.prototype.timeout = function(ms) {
if (typeof ms === 'string') {
ms = milliseconds(ms);
}

// Clamp to range
var INT_MAX = Math.pow(2, 31) - 1;
var range = [0, INT_MAX];
ms = utils.clamp(ms, range);

debug('timeout %d', ms);
this._timeout = parseInt(ms, 10);
return this;
Expand Down

0 comments on commit f2e1b2a

Please sign in to comment.