From 15ba32b489bdaf256662bf991f2bdd6192ed6c5b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 25 Aug 2013 20:54:15 +0800 Subject: [PATCH] Only redirect output to browser when running in CI. --- spec/index.html | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/spec/index.html b/spec/index.html index 6f3fe7aeae3f..c92cb81f58b7 100644 --- a/spec/index.html +++ b/spec/index.html @@ -25,21 +25,23 @@ } require('coffee-script'); // Supports .coffee tests. + var ipc = require('ipc'); // Rediret all output to browser. - var ipc = require('ipc'); - global.__defineGetter__('console', function() { - return { - log: function() { - args = Array.prototype.slice.call(arguments); - ipc.sendChannel('console.log', args); - }, - error: function() { - args = Array.prototype.slice.call(arguments); - ipc.sendChannel('console.error', args); - }, - } - }); + if (isCi) { + global.__defineGetter__('console', function() { + return { + log: function() { + args = Array.prototype.slice.call(arguments); + ipc.sendChannel('console.log', args); + }, + error: function() { + args = Array.prototype.slice.call(arguments); + ipc.sendChannel('console.error', args); + }, + } + }); + } var Mocha = require('mocha');