Skip to content

Commit

Permalink
fix(loadRcFiles): ignore local .lambduh.js files in test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Jun 16, 2017
1 parent 3118f84 commit 01ad65d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/loadRcFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ var dir = process.cwd()
var path = require('path')
var fs = require('fs')
var homedir = require('os').homedir()
var root = path.resolve(__dirname, '..')

while (dir) {
ancestorDirs.push(dir)
var parent = path.dirname(dir)
if (parent === dir) break
// istanbul ignore next
if (process.env.BABEL_ENV === 'test' && root.startsWith(dir)) break
dir = parent
}
if (ancestorDirs.indexOf(homedir) < 0) ancestorDirs.push(homedir)
if (process.env.BABEL_ENV !== 'test' && ancestorDirs.indexOf(homedir) < 0) {
ancestorDirs.push(homedir)
}
ancestorDirs.reverse()

ancestorDirs.forEach(function (dir) {
Expand Down

0 comments on commit 01ad65d

Please sign in to comment.