Skip to content

armgit / mocha

Public Imported from GitHub
0

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

stub process.stdout for client

Tj Holowaychuk2166c4cd7584
diff --git a/mocha.js b/mocha.js
index 88a49679..79d2d2cb 100644
--- a/mocha.js
+++ b/mocha.js
@@ -360,7 +360,7 @@ require.register("mocha.js", function(module, exports, require){
* Library version.
*/
-exports.version = '0.0.1-alpha4';
+exports.version = '0.0.1-alpha5';
exports.interfaces = require('./interfaces');
exports.reporters = require('./reporters');
@@ -437,9 +437,9 @@ var color = exports.color = function(type, str) {
exports.window = {
width: isatty
- ? tty.getWindowSize
- ? tty.getWindowSize()[1]
- : process.stdout.getWindowSize(1)[0]
+ ? process.stdout.getWindowSize
+ ? process.stdout.getWindowSize(1)[0]
+ : tty.getWindowSize()[1]
: 75
};
@@ -2010,6 +2010,8 @@ process.nextTick = function(fn){ setTimeout(fn, 0); };
process.on = function(){};
process.exit = function(status){};
+process.stdout = {};
+
global = this;
// boot
diff --git a/support/tail.js b/support/tail.js
index 6652cab3..e5edc7e6 100644
--- a/support/tail.js
+++ b/support/tail.js
@@ -13,6 +13,7 @@ process = {};
process.nextTick = function(fn){ setTimeout(fn, 0); };
process.on = function(){};
process.exit = function(status){};
+process.stdout = {};
global = this;