Skip to content

Commit fa70351

Browse files
committed
minor code style tweaks
1 parent 84fb575 commit fa70351

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function init(files) {
182182

183183
return handlePaths(files)
184184
.map(function (file) {
185-
return path.resolve('.', file);
185+
return path.resolve(file);
186186
})
187187
.then(function (files) {
188188
if (files.length === 0) {

lib/runner.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function Runner(opts) {
2626
EventEmitter.call(this);
2727

2828
this.results = [];
29-
3029
this.tests = [];
3130

3231
this.test = makeChain({
@@ -156,17 +155,34 @@ Runner.prototype._addTestResult = function (test) {
156155

157156
Runner.prototype.run = function () {
158157
var self = this;
159-
var hasExclusive = Boolean(this.select({exclusive: true, skipped: false, type: 'test'}).length);
160-
var serial = this.select({exclusive: hasExclusive, skipped: false, serial: true, type: 'test'});
161-
var concurrent = this.select({exclusive: hasExclusive, skipped: false, serial: false, type: 'test'});
158+
159+
var hasExclusive = this.select({
160+
exclusive: true,
161+
skipped: false,
162+
type: 'test'
163+
}).length > 0;
164+
165+
var serial = this.select({
166+
exclusive: hasExclusive,
167+
skipped: false,
168+
serial: true,
169+
type: 'test'
170+
});
171+
172+
var concurrent = this.select({
173+
exclusive: hasExclusive,
174+
skipped: false,
175+
serial: false,
176+
type: 'test'
177+
});
162178

163179
var stats = this.stats = {
164180
failCount: 0,
165181
passCount: 0,
166182
testCount: serial.length + concurrent.length
167183
};
168184

169-
// Runner is executed directly in tests, in that case process.send() == undefined
185+
// Runner is executed directly in tests, in that case `process.send() === undefined`
170186
if (process.send) {
171187
send('stats', stats);
172188
}

lib/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ Test.prototype.run = function () {
115115

116116
// TODO(vdemedes): refactor this to avoid storing the promise
117117
if (!this.fn) {
118-
return this.exit();
118+
this.exit();
119+
return undefined;
119120
}
120121

121122
this._timeStart = globals.now();

test/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ test('stack traces for exceptions are corrected using a source map, found via a
228228
test('absolute paths in CLI', function (t) {
229229
t.plan(2);
230230

231-
execCli([path.resolve('.', 'test/fixture/es2015.js')], function (err, stdout, stderr) {
231+
execCli([path.resolve('test/fixture/es2015.js')], function (err, stdout, stderr) {
232232
t.ifError(err);
233233
t.is(stderr.trim(), '1 test passed');
234234
t.end();

0 commit comments

Comments
 (0)