mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Merge pull request #1148 from atom/ks-remove-resource-path
🔥 window.resourcePath
This commit is contained in:
@@ -39,7 +39,9 @@ specPackageName = null
|
||||
specPackagePath = null
|
||||
specProjectPath = null
|
||||
|
||||
if specDirectory = atom.getLoadSettings().specDirectory
|
||||
{specDirectory, resourcePath} = atom.getLoadSettings()
|
||||
|
||||
if specDirectory
|
||||
specPackagePath = path.resolve(specDirectory, '..')
|
||||
try
|
||||
specPackageName = fs.readObjectSync(path.join(specPackagePath, 'package.json'))?.name
|
||||
@@ -68,9 +70,7 @@ beforeEach ->
|
||||
spyOn(atom.menu, 'sendToBrowserProcess')
|
||||
|
||||
# reset config before each spec; don't load or save from/to `config.json`
|
||||
config = new Config
|
||||
resourcePath: window.resourcePath
|
||||
configDirPath: atom.getConfigDirPath()
|
||||
config = new Config({resourcePath, configDirPath: atom.getConfigDirPath()})
|
||||
spyOn(config, 'load')
|
||||
spyOn(config, 'save')
|
||||
config.setDefaults('core', RootView.configDefaults)
|
||||
|
||||
@@ -23,9 +23,10 @@ setSpecDirectory = (specDirectory) ->
|
||||
setSpecField('specDirectory', specDirectory)
|
||||
|
||||
runAllSpecs = ->
|
||||
{resourcePath} = atom.getLoadSettings()
|
||||
# Only run core specs when resource path is the Atom repository
|
||||
if Git.exists(window.resourcePath)
|
||||
requireSpecs(path.join(window.resourcePath, 'spec'))
|
||||
if Git.exists(resourcePath)
|
||||
requireSpecs(path.join(resourcePath, 'spec'))
|
||||
setSpecType('core')
|
||||
|
||||
fixturesPackagesPath = path.join(__dirname, 'fixtures', 'packages')
|
||||
@@ -34,7 +35,7 @@ runAllSpecs = ->
|
||||
packagePaths = _.groupBy packagePaths, (packagePath) ->
|
||||
if packagePath.indexOf("#{fixturesPackagesPath}#{path.sep}") is 0
|
||||
'fixtures'
|
||||
else if packagePath.indexOf("#{window.resourcePath}#{path.sep}") is 0
|
||||
else if packagePath.indexOf("#{resourcePath}#{path.sep}") is 0
|
||||
'bundled'
|
||||
else
|
||||
'user'
|
||||
|
||||
@@ -11,7 +11,6 @@ windowEventHandler = null
|
||||
# This method is called in any window needing a general environment, including specs
|
||||
window.setUpEnvironment = (windowMode) ->
|
||||
atom.windowMode = windowMode
|
||||
window.resourcePath = atom.getLoadSettings().resourcePath
|
||||
atom.initialize()
|
||||
|
||||
# Set up the default event handlers and menus for a non-editor windows.
|
||||
|
||||
Reference in New Issue
Block a user