From f2e1b2a5624e59919e15e7c150aa05c8c8e822c3 Mon Sep 17 00:00:00 2001 From: Craig Taub Date: Tue, 5 May 2020 12:27:08 +0100 Subject: [PATCH] Excl docs in coverage + clamp in suite. --- .nycrc | 1 + lib/suite.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.nycrc b/.nycrc index d4091b1a0f..aac56b8030 100644 --- a/.nycrc +++ b/.nycrc @@ -5,6 +5,7 @@ ], "exclude": [ "coverage/**", + "docs/**", "packages/*/test{,s}/**", "**/*.d.ts", "test{,s}/**", diff --git a/lib/suite.js b/lib/suite.js index d564d8e515..2a64e2db8f 100644 --- a/lib/suite.js +++ b/lib/suite.js @@ -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;