Skip to content

Commit e57b99d

Browse files
committed
fix use of absolute paths
1 parent 71c79e0 commit e57b99d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cli.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ function handlePaths(files) {
196196

197197
return files
198198
.map(function (file) {
199-
var stats = fs.statSync(path.join(process.cwd(), file));
200-
201-
if (stats.isDirectory()) {
199+
if (fs.statSync(file).isDirectory()) {
202200
return handlePaths([path.join(file, '*.js')]);
203201
}
204202

test/test.js

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict';
2+
var path = require('path');
23
var childProcess = require('child_process');
34
var Promise = require('bluebird');
45
var figures = require('figures');
@@ -959,3 +960,13 @@ test('Babel require hook only applies to the test file', function (t) {
959960
t.end();
960961
});
961962
});
963+
964+
test('absolute paths in CLI', function (t) {
965+
t.plan(2);
966+
967+
execCli([path.resolve('.', 'test/fixture/es2015.js')], function (err, stdout, stderr) {
968+
t.ifError(err);
969+
t.is(stderr.trim(), '1 test passed');
970+
t.end();
971+
});
972+
});

0 commit comments

Comments
 (0)