Always assign a project path outside of bundle for legacy package specs

This prevents package specs that don't have a fixtures directory from
attempting to read files out of a non-existent directory inside the ASAR
bundle, which causes ENOTDIR errors in superstring.

If the spec does not have a parent folder containing a fixtures
directory, we now set the default project path to `os.tmpdir()`.
This commit is contained in:
Nathan Sobo
2017-10-25 10:34:43 -06:00
parent 622589f4f7
commit 364964ea0a

View File

@@ -58,7 +58,7 @@ if specPackagePath = FindParentDir.sync(testPaths[0], 'package.json')
if specDirectory = FindParentDir.sync(testPaths[0], 'fixtures')
specProjectPath = path.join(specDirectory, 'fixtures')
else
specProjectPath = path.join(__dirname, 'fixtures')
specProjectPath = require('os').tmpdir()
beforeEach ->
atom.project.setPaths([specProjectPath])