test-agent
Advanced tools
Comparing version 0.12.4 to 0.12.5
@@ -90,3 +90,5 @@ var server = new (require('../websocket-server')), | ||
use(Enhancements.MochaTestEvents). | ||
use(Enhancements.BlanketCoverEvents). | ||
use(Enhancements.QueueTests). | ||
use(Enhancements.StartCoverages). | ||
use(Enhancements.EventMirror). | ||
@@ -93,0 +95,0 @@ use(Enhancements.Watcher); |
@@ -35,2 +35,5 @@ var Client = require('../../node/client'), | ||
}). | ||
option('coverage', { | ||
desc: 'Blanket coverage report' | ||
}). | ||
option('server', { | ||
@@ -73,4 +76,8 @@ desc: 'Location of the websocket server to connect to.', | ||
client.mirrorServerEvents(['set test envs', 'error', 'test data'], true); | ||
client.send('queue tests', {files: files}); | ||
client.mirrorServerEvents(['set test envs', 'error', 'test data', 'coverage data'], true); | ||
if (argv['coverage']) { | ||
client.send('start coverages', {files: files}); | ||
} else { | ||
client.send('queue tests', {files: files}); | ||
} | ||
}); | ||
@@ -82,2 +89,6 @@ | ||
if (argv['coverage']) { | ||
client.use(Apps.BlanketCoverEvents); | ||
} | ||
if(argv['wait-for-event'] && argv['event-timeout']) { | ||
@@ -84,0 +95,0 @@ client.use(Apps.EventOrTimeout, { |
module.exports = exports = { | ||
Broadcast: require('./broadcast'), | ||
MochaTestEvents: require('../../test-agent/common/mocha-test-events'), | ||
BlanketCoverEvents: require('../../test-agent/common/blanket-cover-events'), | ||
Responder: require('./responder'), | ||
@@ -8,2 +9,3 @@ Watcher: require('./watcher'), | ||
QueueTests: require('./queue-tests'), | ||
StartCoverages: require('./start-coverages'), | ||
EventMirror: require('./event-mirror'), | ||
@@ -10,0 +12,0 @@ EventOrTimeout: require('./event-or-timeout'), |
@@ -18,3 +18,4 @@ /** | ||
connect: 'worker ready', | ||
start: 'queue tests' | ||
start: 'queue tests', | ||
sendEvent: 'run tests' | ||
}, | ||
@@ -60,3 +61,3 @@ | ||
}); | ||
server.broadcast(server.stringify('run tests', {tests: list})); | ||
server.broadcast(server.stringify(this.eventNames.sendEvent, {tests: list})); | ||
} | ||
@@ -63,0 +64,0 @@ |
@@ -31,4 +31,8 @@ (function(window) { | ||
this.on('run tests', function(data) { | ||
self.runTests(data.tests || []); | ||
self.runTests(data.tests || [], false); | ||
}); | ||
this.on('run tests with coverage', function(data) { | ||
self.runTests(data.tests || [], true); | ||
}); | ||
}; | ||
@@ -121,3 +125,3 @@ | ||
*/ | ||
proto.runTests = function runTests(tests) { | ||
proto.runTests = function runTests(tests, runCoverage) { | ||
var self = this, | ||
@@ -132,2 +136,5 @@ done = this._emitTestComplete.bind(this); | ||
self.testRunner(self, self._processTests(tests), done); | ||
if (runCoverage) { | ||
self.coverageRunner(self); | ||
} | ||
}); | ||
@@ -134,0 +141,0 @@ }; |
@@ -131,3 +131,3 @@ (function(window) { | ||
*/ | ||
_loadNextDomain: function() { | ||
_loadNextDomain: function(runCoverage) { | ||
var iframe; | ||
@@ -152,2 +152,4 @@ //if we have a current domain | ||
} | ||
this.runCoverage = runCoverage; | ||
}, | ||
@@ -168,3 +170,8 @@ | ||
this.send(iframe, 'set env', group.env); | ||
this.send(iframe, 'run tests', { tests: group.tests }); | ||
if (!this.runCoverage) { | ||
this.send(iframe, 'run tests', { tests: group.tests }); | ||
} else { | ||
this.send(iframe, 'run tests with coverage', { tests: group.tests }); | ||
} | ||
} | ||
@@ -206,3 +213,3 @@ }, | ||
*/ | ||
runTests: function(tests) { | ||
runTests: function(tests, runCoverage) { | ||
var envs; | ||
@@ -213,3 +220,3 @@ this._createTestGroups(tests); | ||
this.worker.send('set test envs', envs); | ||
this._loadNextDomain(); | ||
this._loadNextDomain(runCoverage); | ||
} | ||
@@ -216,0 +223,0 @@ |
@@ -136,5 +136,5 @@ (function(window) { | ||
*/ | ||
require: function(url, callback) { | ||
require: function(url, callback, options) { | ||
this._queue.push( | ||
this._require.bind(this, url, callback) | ||
this._require.bind(this, url, callback, options) | ||
); | ||
@@ -154,3 +154,3 @@ | ||
*/ | ||
_require: function require(url, callback) { | ||
_require: function require(url, callback, options) { | ||
var prefix = this.prefix, | ||
@@ -160,2 +160,3 @@ suffix = '', | ||
element, | ||
key, | ||
document = this.targetWindow.document; | ||
@@ -176,4 +177,2 @@ | ||
var args = arguments; | ||
url = prefix + url + suffix; | ||
@@ -185,2 +184,10 @@ element = document.createElement('script'); | ||
if (options) { | ||
for (key in options) { | ||
if (options.hasOwnProperty(key)) { | ||
element.setAttribute(key, options[key]); | ||
} | ||
} | ||
}; | ||
function oncomplete() { | ||
@@ -187,0 +194,0 @@ if (callback) { |
{ | ||
"name": "test-agent", | ||
"version": "0.12.4", | ||
"version": "0.12.5", | ||
"author": "James Lal", | ||
@@ -9,3 +9,3 @@ "description": "execute client side tests from browser report back to cli", | ||
"type": "git", | ||
"url": "https://github.com/lightsofapollo/js-test-agent.git" | ||
"url": "https://github.com/mozilla-b2g/js-test-agent.git" | ||
}, | ||
@@ -12,0 +12,0 @@ |
Sorry, the diff of this file is too big to display
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
228900
71
7100
2