From d07c79f774cf24b4e366ff618c4350e158062275 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Tue, 4 Aug 2020 10:24:57 -0700 Subject: [PATCH] fix window width problem; closes #4393 looks like maybe a bad merge, but `isBrowser()` was used incorrectly --- lib/reporters/base.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/reporters/base.js b/lib/reporters/base.js index 7d9e01c00a..1f97e319dd 100644 --- a/lib/reporters/base.js +++ b/lib/reporters/base.js @@ -14,7 +14,7 @@ var constants = require('../runner').constants; var EVENT_TEST_PASS = constants.EVENT_TEST_PASS; var EVENT_TEST_FAIL = constants.EVENT_TEST_FAIL; -var isBrowser = require('../utils').isBrowser; +const isBrowser = utils.isBrowser(); function getBrowserWindowSize() { if ('innerHeight' in global) { @@ -34,7 +34,7 @@ exports = module.exports = Base; * Check if both stdio streams are associated with a tty. */ -var isatty = isBrowser ? true : process.stdout.isTTY && process.stderr.isTTY; +var isatty = isBrowser || (process.stdout.isTTY && process.stderr.isTTY); /** * Save log references to avoid tests interfering (see GH-3604). @@ -46,7 +46,7 @@ var consoleLog = console.log; */ exports.useColors = - !utils.isBrowser() && + !isBrowser && (supportsColor.stdout || process.env.MOCHA_COLORS !== undefined); /**