Lines Matching refs:_

15 var _ = require('../lodash.js'),  variable
75 port = ports[Math.min(_.sortedIndex(ports, getOption('port', 9001)), ports.length - 1)],
115 var isAMD = _.includes(tags, 'amd'),
116 isBackbone = _.includes(tags, 'backbone'),
117 isModern = _.includes(tags, 'modern');
130 platforms = _.filter(platforms, function(platform) {
143 platforms = _.filter(platforms, function(platform) {
158 platforms = _.filter(platforms, function(platform) {
211 return browserNameMap[identifier] || _.startCase(identifier);
224 var isArr = _.isArray(defaultValue);
225 return _.reduce(process.argv, function(result, value) {
228 return _.isEmpty(value) ? result : value;
254 var blankLine = _.repeat(' ', _.size(prevLine));
255 prevLine = text = _.truncate(text, { 'length': 40 });
265 logInline('Please wait' + _.repeat('.', (++waitCount % 3) + 1));
277 return _.compact(_.invokeMap((optionToValue(name, string) || '').split(/, */), 'trim'));
291 result = _.get(result, 1);
292 result = result ? _.trim(result) : true;
363 var statusCode = _.get(res, 'statusCode'),
364 taskId = _.first(_.get(body, 'js tests'));
372 bodyStr = _.isObject(body) ? '\n' + JSON.stringify(body) : na,
373 statusStr = _.isFinite(statusCode) ? statusCode : na;
386 this.timestamp = _.now();
405 var completed = _.get(body, 'completed', false),
406 data = _.first(_.get(body, 'js tests')),
407 elapsed = (_.now() - this.timestamp) / 1000,
408 jobId = _.get(data, 'job_id', null),
409 jobResult = _.get(data, 'result', null),
410 jobStatus = _.get(data, 'status', ''),
411 jobUrl = _.get(data, 'url', null),
412 expired = (elapsed >= queueTimeout && !_.includes(jobStatus, 'in progress')),
416 if (_.isObject(jobResult)) {
417 var message = _.get(jobResult, 'message');
434 this._pollerId = _.delay(_.bind(this.status, this), this.statusInterval * 1000);
437 …var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
439 failures = _.get(jobResult, 'failed'),
521 _.merge(this, properties);
522 _.defaults(this.options, _.cloneDeep(jobOptions));
539 this.once('remove', _.iteratee(callback));
545 var onRemove = _.bind(onJobRemove, this);
547 _.defer(onRemove);
550 request.del(_.template('https://saucelabs.com/rest/v1/${user}/jobs/${id}')(this), {
564 this.once('reset', _.iteratee(callback));
580 this.once('restart', _.iteratee(callback));
588 … description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
605 this.once('start', _.iteratee(callback));
610 request.post(_.template('https://saucelabs.com/rest/v1/${user}/js-tests')(this), {
613 }, _.bind(onJobStart, this));
626 this.once('status', _.iteratee(callback));
632 request.post(_.template('https://saucelabs.com/rest/v1/${user}/js-tests/status')(this), {
635 }, _.bind(onJobStatus, this));
648 this.once('stop', _.iteratee(callback));
658 var onStop = _.bind(onGenericStop, this);
660 _.defer(onStop);
663 request.put(_.template('https://saucelabs.com/rest/v1/${user}/jobs/${id}/stop')(this), {
681 _.merge(this, properties);
686 var all = _.map(this.platforms, _.bind(function(platform) {
687 return new Job(_.merge({
701 _.invokeMap(all, 'on', 'complete', function() {
702 _.pull(active, this);
707 tunnel.stop(_.partial(tunnel.emit, 'complete', success));
713 _.invokeMap(all, 'on', 'restart', function() {
714 if (!_.includes(restarted, this)) {
718 var threshold = Math.min(all.length, _.isFinite(throttled) ? throttled : 3);
720 active.length >= threshold && _.isEmpty(_.difference(active, restarted))) {
747 this.once('restart', _.iteratee(callback));
760 var reset = _.after(all.length, _.bind(this.stop, this, onGenericRestart)),
761 stop = _.after(active.length, _.partial(_.invokeMap, all, 'reset', reset));
763 if (_.isEmpty(active)) {
764 _.defer(stop);
766 if (_.isEmpty(all)) {
767 _.defer(reset);
769 _.invokeMap(active, 'stop', function() {
770 _.pull(active, this);
789 this.once('start', _.iteratee(callback));
798 var onStart = _.bind(onTunnelStart, this);
800 this._timeoutId = _.delay(onStart, this.timeout * 1000, false);
822 _.delay(_.bind(job.start, job), ++count * 1000);
835 this.once('stop', _.iteratee(callback));
847 var stop = _.after(active.length, _.bind(function() {
848 var onStop = _.bind(onGenericStop, this);
857 if (_.isEmpty(active)) {
858 _.defer(stop);
860 _.invokeMap(active, 'stop', function() {
861 _.pull(active, this);