test-agent
Advanced tools
@@ -24,6 +24,6 @@ var fsPath = require('path'), | ||
this[key].forEach(function(subkey, i) { | ||
this[key][i] = fsPath.join(fsPath.normalize(this[key][i]), '/'); | ||
this[key][i] = fsPath.join('/', fsPath.normalize(this[key][i]), '/'); | ||
}, this); | ||
} else { | ||
this[key] = fsPath.join(fsPath.normalize(this[key]), '/'); | ||
this[key] = fsPath.join('/', fsPath.normalize(this[key]), '/'); | ||
} | ||
@@ -30,0 +30,0 @@ }; |
@@ -13,3 +13,4 @@ (function(window) { | ||
var Base = TestAgent.Mocha.ReporterBase, | ||
exports = window.TestAgent.Mocha; | ||
exports = window.TestAgent.Mocha, | ||
log = console.log.bind(console); | ||
@@ -31,7 +32,10 @@ MochaReporter.console = window.console; | ||
function consoleShim(type) { | ||
var args = Array.prototype.slice.call(arguments, 1), | ||
message = TestAgent.format.apply(TestAgent, args); | ||
MochaReporter.console.log = function consoleLogShim() { | ||
var args = Array.prototype.slice.call(arguments), | ||
message = TestAgent.format.apply(TestAgent, arguments); | ||
//real console log | ||
log.apply(this, arguments); | ||
// For server | ||
//for server | ||
var stack, messages = args.map(function(item) { | ||
@@ -51,3 +55,3 @@ if (!item) { | ||
if (stack) { | ||
// Re-orgnaize the stack to exlude the above | ||
//re-orgnaize the stack to exlude the above | ||
stack = stack.split('\n').map(function(e) { | ||
@@ -61,4 +65,6 @@ return e.trim().replace(/^at /, ''); | ||
var logDetails = { messages: [message], stack: stack }; | ||
//this is temp | ||
var logDetails = {messages: [message], stack: stack }; | ||
if (MochaReporter.testAgentEnvId) { | ||
@@ -69,11 +75,6 @@ logDetails.testAgentEnvId = MochaReporter.testAgentEnvId; | ||
MochaReporter.send( | ||
JSON.stringify([type, logDetails]) | ||
JSON.stringify(['log', logDetails]) | ||
); | ||
}; | ||
MochaReporter.console.log = consoleShim.bind(null, 'log'); | ||
MochaReporter.console.info = consoleShim.bind(null, 'info'); | ||
MochaReporter.console.warn = consoleShim.bind(null, 'warn'); | ||
MochaReporter.console.error = consoleShim.bind(null, 'error'); | ||
runner.on('suite', function onSuite(suite) { | ||
@@ -80,0 +81,0 @@ indentation++; |
@@ -93,20 +93,4 @@ (function() { | ||
if (!this.coverage) { | ||
this.on({ | ||
'log': function onLog(data) { | ||
console.log.apply(console, data.messages); | ||
}, | ||
'info': function onInfo(data) { | ||
console.info.apply(console, data.messages); | ||
}, | ||
'warn': function onWarn(data) { | ||
console.warn.apply(console, data.messages); | ||
}, | ||
'error': function onError(data) { | ||
console.error.apply(console, data.messages); | ||
} | ||
this.on('log', function onLog(data) { | ||
console.log.apply(console, data.messages); | ||
}); | ||
@@ -113,0 +97,0 @@ } |
{ | ||
"name": "test-agent", | ||
"version": "0.23.0", | ||
"version": "0.23.2", | ||
"author": "James Lal", | ||
@@ -5,0 +5,0 @@ "description": "execute client side tests from browser report back to cli", |
Sorry, the diff of this file is too big to display
251371
-0.36%7842
-0.28%