diff --git a/lib/command/utils.js b/lib/command/utils.js index afac49fe0..b7618f85d 100644 --- a/lib/command/utils.js +++ b/lib/command/utils.js @@ -16,7 +16,7 @@ module.exports.getConfig = function (configFile) { function getTestRoot(currentPath) { if (!currentPath) currentPath = '.'; if (!path.isAbsolute(currentPath)) currentPath = path.join(process.cwd(), currentPath); - return currentPath = !path.extname(currentPath) ? currentPath : path.dirname(currentPath); + return currentPath = fs.lstatSync(currentPath).isDirectory() || !path.extname(currentPath) ? currentPath : path.dirname(currentPath); } module.exports.getTestRoot = getTestRoot;