]> khamidou — GitHub mirrors - electron.git/commitdiff
Only redirect output to browser when running in CI.
authorCheng Zhao <zcbenz@gmail.com>
Sun, 25 Aug 2013 12:54:15 +0000 (20:54 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 25 Aug 2013 12:54:15 +0000 (20:54 +0800)
spec/index.html

index 6f3fe7aeae3f20f54da684a2c220ca667a8e30ed..c92cb81f58b7f69d1327206c386f642f7425b3d5 100644 (file)
   }
 
   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');