Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Fixed getWindowSize() for 0.4.x. Closes #36

Tj Holowaychuk23f9fb7117df
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index 0dc2b92d..69d1758d 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -65,7 +65,9 @@ var color = exports.color = function(type, str) {
exports.window = {
width: isatty
- ? process.stdout.getWindowSize(1)[0]
+ ? tty.getWindowSize
+ ? tty.getWindowSize()
+ : process.stdout.getWindowSize(1)[0]
: 75
};