test-agent
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -0,1 +1,7 @@ | ||
# 0.9.0 | ||
- MochaDriver now allows multiple test helpers. | ||
# 0.8.0 | ||
- added support for mocha 1.7x | ||
# 0.7.3 | ||
@@ -2,0 +8,0 @@ - fixed a bug where numerious extra sockets where opened. |
@@ -41,4 +41,12 @@ (function(window) { | ||
/** | ||
* location of test helper. | ||
* location of test helper(s). | ||
* | ||
* Will be loaded before any of your tests. | ||
* May pass more then one via an array. | ||
* | ||
* Each helper is loaded completely before | ||
* requiring any other helpers allowing multiple | ||
* files to be requested prior to executing tests. | ||
* | ||
* @type {String|Array} | ||
*/ | ||
@@ -84,2 +92,25 @@ testHelperUrl: './test/helper.js', | ||
_loadTestHelpers: function(box, callback) { | ||
var helpers = this.testHelperUrl; | ||
if (typeof(helpers) === 'string') { | ||
helpers = [helpers]; | ||
} | ||
var current = 0; | ||
var max = helpers.length; | ||
function next() { | ||
if (current < max) { | ||
box.require(helpers[current], function() { | ||
current++; | ||
next(); | ||
}); | ||
} else { | ||
callback(); | ||
} | ||
} | ||
next(); | ||
}, | ||
_testRunner: function _testRunner(worker, tests, done) { | ||
@@ -110,3 +141,3 @@ var box = worker.sandbox.getWindow(), | ||
box.require(this.testHelperUrl, function(){ | ||
self._loadTestHelpers(box, function() { | ||
tests.forEach(function(test) { | ||
@@ -113,0 +144,0 @@ box.require(test); |
{ | ||
"name": "test-agent", | ||
"version": "0.8.0", | ||
"version": "0.9.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 not supported yet
213569
6666