diff --git a/lib/default_stream.js b/lib/default_stream.js index c8e99180..12051773 100644 --- a/lib/default_stream.js +++ b/lib/default_stream.js @@ -21,8 +21,7 @@ module.exports = function () { if (fs.writeSync && /^win/.test(process.platform)) { try { fs.writeSync(1, line + '\n'); } catch (e) { stream.emit('error', e) } - } - else { + } else { try { console.log(line) } catch (e) { stream.emit('error', e) } } diff --git a/lib/results.js b/lib/results.js index 35bf09f3..36586530 100644 --- a/lib/results.js +++ b/lib/results.js @@ -59,8 +59,7 @@ Results.prototype.createStream = function (opts) { }); }); self.on('done', function () { output.queue(null) }); - } - else { + } else { output = resumer(); output.queue('TAP version 13\n'); self._stream.pipe(output); @@ -149,8 +148,7 @@ function encodeResult (res, count) { if (Math.max(ex.length, ac.length) > 65 || invalidYaml(ex) || invalidYaml(ac)) { output += inner + 'expected: |-\n' + inner + ' ' + ex + '\n'; output += inner + 'actual: |-\n' + inner + ' ' + ac + '\n'; - } - else { + } else { output += inner + 'expected: ' + ex + '\n'; output += inner + 'actual: ' + ac + '\n'; } diff --git a/lib/test.js b/lib/test.js index 0b48ed6f..d08ad99b 100644 --- a/lib/test.js +++ b/lib/test.js @@ -29,11 +29,9 @@ var getTestArgs = function (name_, opts_, cb_) { var t = typeof arg; if (t === 'string') { name = arg; - } - else if (t === 'object') { + } else if (t === 'object') { opts = arg || opts; - } - else if (t === 'function') { + } else if (t === 'function') { cb = arg; } } @@ -66,7 +64,7 @@ function Test (name_, opts_, cb_) { return val.apply(self, arguments); }; } - else return val; + return val; })(this, this[prop]); } } @@ -176,8 +174,7 @@ Test.prototype._exit = function () { actual : this.assertCount, exiting : true }); - } - else if (!this.ended) { + } else if (!this.ended) { this.fail('test exited without ending', { exiting: true }); @@ -188,9 +185,7 @@ Test.prototype._pendingAsserts = function () { if (this._plan === undefined) { return 1; } - else { - return this._plan - (this._progeny.length + this.assertCount); - } + return this._plan - (this._progeny.length + this.assertCount); }; Test.prototype._assert = function assert (ok, opts) {