pulsar/spec/spec-bootstrap.coffee

31 lines
981 B
CoffeeScript
Raw Normal View History

# Start the crash reporter before anything else.
require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub')
2014-03-18 12:32:07 +04:00
path = require 'path'
try
2013-09-18 05:58:41 +04:00
require '../src/window'
2013-09-26 21:13:16 +04:00
Atom = require '../src/atom'
window.atom = Atom.loadOrCreate('spec')
# Show window synchronously so a focusout doesn't fire on input elements
# that are focused in the very first spec run.
atom.getCurrentWindow().show() unless atom.getLoadSettings().exitWhenDone
2013-09-18 01:54:33 +04:00
{runSpecSuite} = require './jasmine-helper'
# Add 'exports' to module search path.
exportsPath = path.join(atom.getLoadSettings().resourcePath, 'exports')
2014-03-18 12:32:07 +04:00
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
if atom?.getLoadSettings().exitWhenDone
2013-10-18 02:38:47 +04:00
console.error(error.stack ? error)
atom.exit(1)
else
throw error