From 4cde537a7f4a1ec8d112a683d734b754287f61ff Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 4 May 2014 16:13:07 -0700 Subject: [PATCH] Cleanup initialization of `Job` and `Tunnel` instances. --- test/saucelabs.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/saucelabs.js b/test/saucelabs.js index fd50c0cf0..c197cab83 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -464,11 +464,8 @@ function Job(properties) { _.defaults(this.options, _.cloneDeep(jobOptions)); this.attempts = 0; - this.checking = false; - this.failed = false; - this.running = false; - this.starting = false; - this.stopping = false; + this.checking = this.failed = this.running = this.starting = this.stopping = false; + this.id = this.result = this.url = null; } util.inherits(Job, EventEmitter); @@ -606,11 +603,6 @@ function Tunnel(properties) { this.retries = maxTunnelRetries; _.merge(this, properties); - this.attempts = 0; - this.running = false; - this.starting = false; - this.stopping = false; - var active = [], queue = []; @@ -660,6 +652,8 @@ function Tunnel(properties) { _.invoke(all, 'reset'); }); + this.attempts = 0; + this.running = this.starting = this.stopping = false; this.jobs = { 'active': active, 'all': all, 'queue': queue }; this.connection = new SauceTunnel(this.user, this.pass, this.id, this.tunneled, this.timeout); }