Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

test-agent

Package Overview
Dependencies
Maintainers
6
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-agent - npm Package Compare versions

Comparing version 0.23.8 to 0.24.0

2

lib/test-agent/browser-worker/mocha-driver.js

@@ -141,3 +141,3 @@ (function(window) {

// https://developer.mozilla.org/en-US/docs/Site_Compatibility_for_Firefox_21
var globalIgnores = ['0', '1', '2', '3', '4', '5'];
var globalIgnores = ['0', '1', '2', '3', '4', '5', '_$blanket'];

@@ -144,0 +144,0 @@ //setup mocha

@@ -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,9 +32,25 @@ MochaReporter.console = window.console;

function consoleShim(type) {
var args = Array.prototype.slice.call(arguments, 1),
messages = args,
stack = new Error().stack;
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
var stack, messages = args.map(function(item) {
if (!item) {
return item;
}
return (item.toString) ? item.toString() : item;
});
try {
throw new Error();
} catch (e) {
stack = e.stack;
}
if (stack) {
// Re-organize the stack to exlude the above
//re-orgnaize the stack to exlude the above
stack = stack.split('\n').map(function(e) {

@@ -47,8 +64,5 @@ return e.trim().replace(/^at /, '');

if (type === 'trace') {
messages = [stack];
type = 'log';
}
//this is temp
var logDetails = {messages: [message], stack: stack };
var logDetails = { messages: messages, stack: stack };

@@ -60,14 +74,6 @@ if (MochaReporter.testAgentEnvId) {

MochaReporter.send(
JSON.stringify([type, logDetails])
JSON.stringify(['log', logDetails])
);
};
MochaReporter.console.log = consoleShim.bind(null, 'log');
MochaReporter.console.debug = 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');
MochaReporter.console.dir = consoleShim.bind(null, 'dir');
MochaReporter.console.trace = consoleShim.bind(null, 'trace');
runner.on('suite', function onSuite(suite) {

@@ -74,0 +80,0 @@ indentation++;

@@ -93,24 +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);
},
'dir': function onDir(data) {
console.dir.apply(console, data.messages);
}
this.on('log', function onLog(data) {
console.log.apply(console, data.messages);
});

@@ -117,0 +97,0 @@ }

{
"name": "test-agent",
"version": "0.23.8",
"version": "0.24.0",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc