diff --git a/src/initialize-application-window.js b/src/initialize-application-window.js index 80e266653..c7278c0c8 100644 --- a/src/initialize-application-window.js +++ b/src/initialize-application-window.js @@ -32,7 +32,7 @@ module.exports = function({ blobStore }) { const { ipcRenderer } = require('electron'); const { resourcePath, devMode } = getWindowLoadSettings(); require('./electron-shims'); - addAtomExport(); + addAtomExport(global.atom); // Make React faster if (!devMode && process.env.NODE_ENV == null) { diff --git a/src/initialize-new-test-window.js b/src/initialize-new-test-window.js index 30189c974..7bb8ccf42 100644 --- a/src/initialize-new-test-window.js +++ b/src/initialize-new-test-window.js @@ -9,8 +9,6 @@ module.exports = async function({ blobStore, globalAtom }) { const { remote } = require('electron'); const getWindowLoadSettings = require('./get-window-load-settings'); - console.log("WATTT????") - const exitWithStatusCode = function(status) { remote.app.emit('will-quit'); remote.process.exit(status); @@ -84,9 +82,6 @@ module.exports = async function({ blobStore, globalAtom }) { window.addEventListener('keydown', handleKeydown, { capture: true }); - addAtomExport(); - updateProcessEnv(env); - // Set up optional transpilation for packages under test if any const FindParentDir = require('find-parent-dir'); const packageRoot = FindParentDir.sync(testPaths[0], 'package.json'); @@ -134,6 +129,11 @@ module.exports = async function({ blobStore, globalAtom }) { applicationDelegate, window, document, configDirPath: process.env.ATOM_HOME }) + addAtomExport(window.atom); + updateProcessEnv(env); + atom.packages.serviceHub.provide('pulsar.api', '0.1.0', { + moduleName: '@pulsar/test', exports: require('./mocha-test-runner/helpers') + }) // Set load paths for the package's test runner let loadPaths = vm.runInThisContext('module.paths') diff --git a/src/initialize-test-window.js b/src/initialize-test-window.js index 01f65ac60..c1c2e008f 100644 --- a/src/initialize-test-window.js +++ b/src/initialize-test-window.js @@ -87,9 +87,7 @@ module.exports = async function({ blobStore }) { window.addEventListener('keydown', handleKeydown, { capture: true }); - // Add 'exports' to module search path. - addAtomExport(); - + addAtomExport(atom); updateProcessEnv(env); // Set up optional transpilation for packages under test if any