testee-client
Advanced tools
Comparing version 0.4.0 to 0.5.0
{ | ||
"name": "testee-client", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Testee testing framework client adapters", | ||
@@ -5,0 +5,0 @@ "main": "src/index", |
@@ -44,2 +44,4 @@ require('core-js/client/core'); | ||
logs: options.app.service('api/logs'), | ||
runner: function() { | ||
@@ -58,2 +60,6 @@ if (!this._runner) { | ||
init: function() { | ||
var oldLog = window.console && window.console.log; | ||
var oldError = window.console && window.console.error; | ||
var self = this; | ||
if (window.QUnit) { | ||
@@ -74,2 +80,14 @@ this.initQUnit(window.QUnit); | ||
} | ||
if(typeof oldLog === 'function' && typeof oldError === 'function') { | ||
window.console.log = function() { | ||
self.runner().log('log', arguments); | ||
return oldLog.apply(this, arguments); | ||
}; | ||
window.console.error = function() { | ||
self.runner().log('error', arguments); | ||
return oldError.apply(this, arguments); | ||
}; | ||
} | ||
}, | ||
@@ -76,0 +94,0 @@ |
@@ -19,13 +19,3 @@ var _ = { | ||
this.connect = this.connect.then(function() { | ||
return new Promise(function(resolve, reject) { | ||
args.push({}); | ||
args.push(function(error, data) { | ||
if (error) { | ||
reject(data); | ||
} else { | ||
resolve(data); | ||
} | ||
}); | ||
service[method].apply(service, args); | ||
}); | ||
return service[method].apply(service, args); | ||
}); | ||
@@ -36,2 +26,15 @@ | ||
log: function(type, args) { | ||
var convertedArgs = []; | ||
for(var i = 0; i < args.length; i++) { | ||
convertedArgs.push(args[i]); | ||
} | ||
this.call('logs', 'create', { | ||
parent: this._root.id, | ||
type: type, | ||
args: convertedArgs | ||
}); | ||
}, | ||
start: function(data) { | ||
@@ -41,2 +44,3 @@ data = Object.assign({ | ||
}, file, data); | ||
this._root = data; | ||
this.call('runs', 'create', data); | ||
@@ -43,0 +47,0 @@ }, |
@@ -11,3 +11,3 @@ function inRange(expected, current, range) { | ||
current = actual[key]; | ||
if (expected instanceof RegExp) { | ||
@@ -54,2 +54,3 @@ ok(expected.test(current), name + ': ' + current + ' matches ' + expected.toString()); | ||
app.use('api/coverages', expectationService('api/coverages')); | ||
app.use('api/logs', expectationService('api/logs')); | ||
@@ -56,0 +57,0 @@ var options = window.Testee[name] = { |
@@ -50,2 +50,8 @@ (function(window, undefined) { | ||
}, { | ||
"name": "api/logs::create", | ||
"data": { | ||
"type": "error", | ||
"args": [ "This test failed" ] | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
@@ -74,2 +80,8 @@ "data": { | ||
}, { | ||
"name": "api/logs::create", | ||
"data": { | ||
"type": "log", | ||
"args": [ "Fail" ] | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
@@ -76,0 +88,0 @@ "data": { |
@@ -5,2 +5,3 @@ module('Test module'); | ||
equal('A', 'B', 'This test should fail'); | ||
console.error('This test failed'); | ||
}); | ||
@@ -10,2 +11,3 @@ | ||
ok(true, 'Test ran!'); | ||
console.log('Fail'); | ||
}); | ||
@@ -12,0 +14,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1164587
21257
19
15