Fix setting NODE_PATH in specs window.

This commit is contained in:
Cheng Zhao
2014-03-18 15:57:16 +08:00
parent 0ee3421cbc
commit 8bf1464b64

View File

@@ -26,6 +26,13 @@ setSpecDirectory = (specDirectory) ->
runAllSpecs = ->
{resourcePath} = atom.getLoadSettings()
# Add 'src/exports' to module search path.
exportsPath = path.resolve(resourcePath, 'exports')
require('module').globalPaths.push(exportsPath)
# Still set NODE_PATH since tasks may need it.
process.env.NODE_PATH = exportsPath
# Only run core specs when resource path is the Atom repository
if Git.exists(resourcePath)
requireSpecs(path.join(resourcePath, 'spec'))