From 18d53231ba614e330fabdca85798976082cb01fa Mon Sep 17 00:00:00 2001 From: Oussama Elgoumri Date: Sun, 4 Jun 2017 04:46:41 +0000 Subject: [PATCH] check if currentPath is directory int: lib/command/utils.js#getTestRoot --- lib/command/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;