mirror of
https://github.com/atom/atom.git
synced 2026-01-26 23:38:48 -05:00
Merge pull request #18801 from atom/aw/tests-load-local-packages
Use a temporary directory for ATOM_HOME in tests
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
Grim = require 'grim'
|
||||
fs = require 'fs-plus'
|
||||
temp = require 'temp'
|
||||
path = require 'path'
|
||||
{ipcRenderer} = require 'electron'
|
||||
|
||||
temp.track()
|
||||
|
||||
module.exports = ({logFile, headless, testPaths, buildAtomEnvironment}) ->
|
||||
window[key] = value for key, value of require '../vendor/jasmine'
|
||||
require 'jasmine-tagged'
|
||||
@@ -17,13 +20,15 @@ module.exports = ({logFile, headless, testPaths, buildAtomEnvironment}) ->
|
||||
get: -> documentTitle
|
||||
set: (title) -> documentTitle = title
|
||||
|
||||
atomHome = temp.mkdirSync prefix: 'atom-test-home-'
|
||||
|
||||
ApplicationDelegate = require '../src/application-delegate'
|
||||
applicationDelegate = new ApplicationDelegate()
|
||||
applicationDelegate.setRepresentedFilename = ->
|
||||
applicationDelegate.setWindowDocumentEdited = ->
|
||||
window.atom = buildAtomEnvironment({
|
||||
applicationDelegate, window, document,
|
||||
configDirPath: process.env.ATOM_HOME
|
||||
configDirPath: atomHome
|
||||
enablePersistence: false
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user