2012-03-15 21:46:40 +04:00
|
|
|
module.exports.runSpecSuite = (specSuite, logErrors=true) ->
|
|
|
|
{$$} = require 'space-pen'
|
|
|
|
nakedLoad 'jasmine'
|
|
|
|
nakedLoad 'jasmine-atom-reporter'
|
|
|
|
nakedLoad 'jasmine-console-reporter'
|
|
|
|
nakedLoad 'jasmine-focused'
|
|
|
|
|
|
|
|
$ = require 'jquery'
|
|
|
|
|
|
|
|
$('body').append $$ ->
|
|
|
|
@div id: 'jasmine-content'
|
|
|
|
|
|
|
|
reporter = if atom.headless
|
|
|
|
new jasmine.ConsoleReporter(document, logErrors)
|
|
|
|
else
|
|
|
|
new jasmine.AtomReporter(document)
|
|
|
|
|
|
|
|
require specSuite
|
|
|
|
jasmineEnv = jasmine.getEnv()
|
|
|
|
jasmineEnv.addReporter(reporter)
|
|
|
|
jasmineEnv.specFilter = (spec) -> reporter.specFilter(spec)
|
2012-03-27 22:52:55 +04:00
|
|
|
jasmineEnv.execute()
|