mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Update test/saucelabs.js for lodash v4.
This commit is contained in:
@@ -270,7 +270,7 @@ function isJobId(value) {
|
|||||||
*/
|
*/
|
||||||
function logInline(text) {
|
function logInline(text) {
|
||||||
var blankLine = _.repeat(' ', _.size(prevLine));
|
var blankLine = _.repeat(' ', _.size(prevLine));
|
||||||
prevLine = text = _.trunc(text, 40);
|
prevLine = text = _.trunc(text, { 'length': 40 });
|
||||||
process.stdout.write(text + blankLine.slice(text.length) + '\r');
|
process.stdout.write(text + blankLine.slice(text.length) + '\r');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -554,7 +554,7 @@ util.inherits(Job, EventEmitter);
|
|||||||
* @param {Object} Returns the job instance.
|
* @param {Object} Returns the job instance.
|
||||||
*/
|
*/
|
||||||
Job.prototype.remove = function(callback) {
|
Job.prototype.remove = function(callback) {
|
||||||
this.once('remove', _.callback(callback));
|
this.once('remove', _.iteratee(callback));
|
||||||
if (this.removing) {
|
if (this.removing) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -579,7 +579,7 @@ Job.prototype.remove = function(callback) {
|
|||||||
* @param {Object} Returns the job instance.
|
* @param {Object} Returns the job instance.
|
||||||
*/
|
*/
|
||||||
Job.prototype.reset = function(callback) {
|
Job.prototype.reset = function(callback) {
|
||||||
this.once('reset', _.callback(callback));
|
this.once('reset', _.iteratee(callback));
|
||||||
if (this.resetting) {
|
if (this.resetting) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -595,7 +595,7 @@ Job.prototype.reset = function(callback) {
|
|||||||
* @param {Object} Returns the job instance.
|
* @param {Object} Returns the job instance.
|
||||||
*/
|
*/
|
||||||
Job.prototype.restart = function(callback) {
|
Job.prototype.restart = function(callback) {
|
||||||
this.once('restart', _.callback(callback));
|
this.once('restart', _.iteratee(callback));
|
||||||
if (this.restarting) {
|
if (this.restarting) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -620,7 +620,7 @@ Job.prototype.restart = function(callback) {
|
|||||||
* @param {Object} Returns the job instance.
|
* @param {Object} Returns the job instance.
|
||||||
*/
|
*/
|
||||||
Job.prototype.start = function(callback) {
|
Job.prototype.start = function(callback) {
|
||||||
this.once('start', _.callback(callback));
|
this.once('start', _.iteratee(callback));
|
||||||
if (this.starting || this.running) {
|
if (this.starting || this.running) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -641,7 +641,7 @@ Job.prototype.start = function(callback) {
|
|||||||
* @param {Object} Returns the job instance.
|
* @param {Object} Returns the job instance.
|
||||||
*/
|
*/
|
||||||
Job.prototype.status = function(callback) {
|
Job.prototype.status = function(callback) {
|
||||||
this.once('status', _.callback(callback));
|
this.once('status', _.iteratee(callback));
|
||||||
if (this.checking || this.removing || this.resetting || this.restarting || this.starting || this.stopping) {
|
if (this.checking || this.removing || this.resetting || this.restarting || this.starting || this.stopping) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -663,7 +663,7 @@ Job.prototype.status = function(callback) {
|
|||||||
* @param {Object} Returns the job instance.
|
* @param {Object} Returns the job instance.
|
||||||
*/
|
*/
|
||||||
Job.prototype.stop = function(callback) {
|
Job.prototype.stop = function(callback) {
|
||||||
this.once('stop', _.callback(callback));
|
this.once('stop', _.iteratee(callback));
|
||||||
if (this.stopping) {
|
if (this.stopping) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -701,14 +701,14 @@ function Tunnel(properties) {
|
|||||||
var active = [],
|
var active = [],
|
||||||
queue = [];
|
queue = [];
|
||||||
|
|
||||||
var all = _.map(this.platforms, function(platform) {
|
var all = _.map(this.platforms, _.bind(function(platform) {
|
||||||
return new Job(_.merge({
|
return new Job(_.merge({
|
||||||
'user': this.user,
|
'user': this.user,
|
||||||
'pass': this.pass,
|
'pass': this.pass,
|
||||||
'tunnel': this,
|
'tunnel': this,
|
||||||
'options': { 'platforms': [platform] }
|
'options': { 'platforms': [platform] }
|
||||||
}, this.job));
|
}, this.job));
|
||||||
}, this);
|
}, this));
|
||||||
|
|
||||||
var completed = 0,
|
var completed = 0,
|
||||||
restarted = [],
|
restarted = [],
|
||||||
@@ -762,7 +762,7 @@ util.inherits(Tunnel, EventEmitter);
|
|||||||
* @param {Function} callback The function called once the tunnel is restarted.
|
* @param {Function} callback The function called once the tunnel is restarted.
|
||||||
*/
|
*/
|
||||||
Tunnel.prototype.restart = function(callback) {
|
Tunnel.prototype.restart = function(callback) {
|
||||||
this.once('restart', _.callback(callback));
|
this.once('restart', _.iteratee(callback));
|
||||||
if (this.restarting) {
|
if (this.restarting) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -804,7 +804,7 @@ Tunnel.prototype.restart = function(callback) {
|
|||||||
* @param {Object} Returns the tunnel instance.
|
* @param {Object} Returns the tunnel instance.
|
||||||
*/
|
*/
|
||||||
Tunnel.prototype.start = function(callback) {
|
Tunnel.prototype.start = function(callback) {
|
||||||
this.once('start', _.callback(callback));
|
this.once('start', _.iteratee(callback));
|
||||||
if (this.starting || this.running) {
|
if (this.starting || this.running) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -847,7 +847,7 @@ Tunnel.prototype.dequeue = function() {
|
|||||||
* @param {Object} Returns the tunnel instance.
|
* @param {Object} Returns the tunnel instance.
|
||||||
*/
|
*/
|
||||||
Tunnel.prototype.stop = function(callback) {
|
Tunnel.prototype.stop = function(callback) {
|
||||||
this.once('stop', _.callback(callback));
|
this.once('stop', _.iteratee(callback));
|
||||||
if (this.stopping) {
|
if (this.stopping) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user