Skip to content

Commit

Permalink
feat(browser): browser reporter provides default options if not provided
Browse files Browse the repository at this point in the history
The default options are basically the same as the cli's ones.
  • Loading branch information
abe33 committed Jun 13, 2013
1 parent b843a18 commit c266c1f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
35 changes: 32 additions & 3 deletions lib/browser_reporter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 25 additions & 2 deletions src/browser_reporter.coffee
Expand Up @@ -266,6 +266,29 @@ class spectacular.BrowserReporter
cache = {}
loaders = {}

window.options = window.options or {}

defaults =
coffee: false
verbose: false
profile: false
trace: true
longTrace: false
showSource: true
documentation: false
matchersRoot: './specs/support/matchers'
helpersRoot: './specs/support/helpers'
fixturesRoot: './specs/support/fixtures'
noMatchers: false
noHelpers: false
noColors: false
server: false
globs: []

window.options[k] = v for k,v of defaults when not k of window.options

window.paths = window.paths or []

options.loadFile = (file) ->

promise = new spectacular.Promise
Expand All @@ -291,10 +314,10 @@ options.loadFile = (file) ->

promise

spectacular.env = new spectacular.Environment(options)
spectacular.env = new spectacular.Environment(window.options)
spectacular.env.globalize()
spectacular.env.runner.loadStartedAt = new Date()
spectacular.env.runner.paths = paths
spectacular.env.runner.paths = window.paths

currentWindowOnload = window.onload
window.onload = ->
Expand Down

0 comments on commit c266c1f

Please sign in to comment.