Fix specs on Mac.

This commit is contained in:
Cheng Zhao 2014-03-18 16:32:07 +08:00
parent 19ab197bc1
commit f2e5b480e1
2 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,8 @@
# Start the crash reporter before anything else.
require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub')
path = require 'path'
try
require '../src/window'
Atom = require '../src/atom'
@ -12,6 +14,12 @@ try
{runSpecSuite} = require './jasmine-helper'
# Add 'src/exports' to module search path.
exportsPath = path.resolve(atom.getLoadSettings().resourcePath, 'exports')
require('module').globalPaths.push(exportsPath)
# Still set NODE_PATH since tasks may need it.
process.env.NODE_PATH = exportsPath
document.title = "Spec Suite"
runSpecSuite './spec-suite', atom.getLoadSettings().logFile
catch error

View File

@ -27,12 +27,6 @@ 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'))