Skip to content

Commit

Permalink
[Cleanup] elses need cuddles
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 4, 2016
1 parent c7859a2 commit 995ddb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions lib/default_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}
Expand Down
6 changes: 2 additions & 4 deletions lib/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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';
}
Expand Down
15 changes: 5 additions & 10 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -66,7 +64,7 @@ function Test (name_, opts_, cb_) {
return val.apply(self, arguments);
};
}
else return val;
return val;
})(this, this[prop]);
}
}
Expand Down Expand Up @@ -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
});
Expand All @@ -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) {
Expand Down

0 comments on commit 995ddb2

Please sign in to comment.