diff --git a/lib/cmds/test.js b/lib/cmds/test.js index 00839dc..375a416 100644 --- a/lib/cmds/test.js +++ b/lib/cmds/test.js @@ -5,6 +5,8 @@ http://yuilibrary.com/license/ */ var log = require('../log'), util = require('../util'), + find = util.find, + CWD = process.cwd(), git = require('../git'), path = require('path'), portfinder = require('portfinder'), @@ -433,7 +435,13 @@ mods = { canBatch = true; } if (canBatch) { - base = path.join(git.findRoot(), '../src'); + find(CWD, 'package.json', function(err, file) { + if (file) { + base = path.join(path.dirname(file), 'src'); + } else { + base = path.join(git.findRoot(), '../src'); + } + }); if (!this.modules) { this.modules = []; batch = fs.readdirSync(base);