master
  1Teaspoon.configure do |config|
  2  # Determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
  3  # `http://localhost:3000/jasmine` to run your tests.
  4  config.mount_at = "/teaspoon"
  5
  6  # Specifies the root where Teaspoon will look for files. If you're testing an engine using a dummy application it can
  7  # be useful to set this to your engines root (e.g. `Teaspoon::Engine.root`).
  8  # Note: Defaults to `Rails.root` if nil.
  9  config.root = nil
 10
 11  # Paths that will be appended to the Rails assets paths
 12  # Note: Relative to `config.root`.
 13  config.asset_paths = ["spec/javascripts", "spec/javascripts/stylesheets"]
 14
 15  # Fixtures are rendered through a controller, which allows using HAML, RABL/JBuilder, etc. Files in these paths will
 16  # be rendered as fixtures.
 17  config.fixture_paths = ["spec/javascripts/fixtures"]
 18
 19  # SUITES
 20  #
 21  # You can modify the default suite configuration and create new suites here. Suites are isolated from one another.
 22  #
 23  # When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
 24  # omit various directives and the ones defined in the default suite will be used.
 25  #
 26  # To run a specific suite
 27  # - in the browser: http://localhost/teaspoon/[suite_name]
 28  # - with the rake task: rake teaspoon suite=[suite_name]
 29  # - with the cli: teaspoon --suite=[suite_name]
 30  config.suite do |suite|
 31    # Specify the framework you would like to use. This allows you to select versions, and will do some basic setup for
 32    # you -- which you can override with the directives below. This should be specified first, as it can override other
 33    # directives.
 34    # Note: If no version is specified, the latest is assumed.
 35    #
 36    # Versions: 1.3.1, 2.0.3, 2.1.3, 2.2.0, 2.2.1, 2.3.4
 37    suite.use_framework :jasmine, "2.3.4"
 38
 39    # Specify a file matcher as a regular expression and all matching files will be loaded when the suite is run. These
 40    # files need to be within an asset path. You can add asset paths using the `config.asset_paths`.
 41    suite.matcher = "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}"
 42
 43    # Load additional JS files, but requiring them in your spec helper is the preferred way to do this.
 44    #suite.javascripts = []
 45
 46    # You can include your own stylesheets if you want to change how Teaspoon looks.
 47    # Note: Spec related CSS can and should be loaded using fixtures.
 48    #suite.stylesheets = ["teaspoon"]
 49
 50    # This suites spec helper, which can require additional support files. This file is loaded before any of your test
 51    # files are loaded.
 52    suite.helper = "spec_helper"
 53
 54    # Partial to be rendered in the head tag of the runner. You can use the provided ones or define your own by creating
 55    # a `_boot.html.erb` in your fixtures path, and adjust the config to `"/boot"` for instance.
 56    #
 57    # Available: boot, boot_require_js
 58    suite.boot_partial = "boot"
 59
 60    # Partial to be rendered in the body tag of the runner. You can define your own to create a custom body structure.
 61    suite.body_partial = "body"
 62
 63    # Hooks allow you to use `Teaspoon.hook("fixtures")` before, after, or during your spec run. This will make a
 64    # synchronous Ajax request to the server that will call all of the blocks you've defined for that hook name.
 65    #suite.hook :fixtures, &proc{}
 66
 67    # Determine whether specs loaded into the test harness should be embedded as individual script tags or concatenated
 68    # into a single file. Similar to Rails' asset `debug: true` and `config.assets.debug = true` options. By default, 
 69    # Teaspoon expands all assets to provide more valuable stack traces that reference individual source files.
 70    #suite.expand_assets = true
 71
 72    # Non-.js file extensions Teaspoon should consider JavaScript files
 73    #suite.js_extensions = [/(\.js)?.coffee/, /(\.js)?.es6/, ".es6.js"]
 74  end
 75
 76  # Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
 77  # be run in the default suite -- but can be focused into a more specific suite.
 78  #config.suite :targeted do |suite|
 79  #  suite.matcher = "spec/javascripts/targeted/*_spec.{js,js.coffee,coffee}"
 80  #end
 81
 82  # CONSOLE RUNNER SPECIFIC
 83  #
 84  # These configuration directives are applicable only when running via the rake task or command line interface. These
 85  # directives can be overridden using the command line interface arguments or with ENV variables when using the rake
 86  # task.
 87  #
 88  # Command Line Interface:
 89  # teaspoon --driver=phantomjs --server-port=31337 --fail-fast=true --format=junit --suite=my_suite /spec/file_spec.js
 90  #
 91  # Rake:
 92  # teaspoon DRIVER=phantomjs SERVER_PORT=31337 FAIL_FAST=true FORMATTERS=junit suite=my_suite
 93
 94  # Specify which headless driver to use. Supports PhantomJS, Selenium Webdriver and BrowserStack Webdriver.
 95  #
 96  # Available: :phantomjs, :selenium, :browserstack, :capybara_webkit
 97  # PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
 98  # Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
 99  # BrowserStack Webdriver: https://github.com/modeset/teaspoon/wiki/Using-BrowserStack-WebDriver
100  # Capybara Webkit: https://github.com/modeset/teaspoon/wiki/Using-Capybara-Webkit
101  #config.driver = :phantomjs
102
103  # Specify additional options for the driver.
104  #
105  # PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
106  # Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
107  # BrowserStack Webdriver: https://github.com/modeset/teaspoon/wiki/Using-BrowserStack-WebDriver
108  # Capybara Webkit: https://github.com/modeset/teaspoon/wiki/Using-Capybara-Webkit
109  #config.driver_options = nil
110
111  # Specify the timeout for the driver. Specs are expected to complete within this time frame or the run will be
112  # considered a failure. This is to avoid issues that can arise where tests stall.
113  #config.driver_timeout = 180
114
115  # Specify a server to use with Rack (e.g. thin, mongrel). If nil is provided Rack::Server is used.
116  #config.server = nil
117
118  # Specify a host to run on a specific host, otherwise Teaspoon will use 127.0.0.1.
119  #config.server_host = nil
120
121  # Specify a port to run on a specific port, otherwise Teaspoon will use a random available port.
122  #config.server_port = nil
123
124  # Timeout for starting the server in seconds. If your server is slow to start you may have to bump this, or you may
125  # want to lower this if you know it shouldn't take long to start.
126  #config.server_timeout = 20
127
128  # Force Teaspoon to fail immediately after a failing suite. Can be useful to make Teaspoon fail early if you have
129  # several suites, but in environments like CI this may not be desirable.
130  #config.fail_fast = true
131
132  # Specify the formatters to use when outputting the results.
133  # Note: Output files can be specified by using `"junit>/path/to/output.xml"`.
134  #
135  # Available: :dot, :clean, :documentation, :json, :junit, :pride, :rspec_html, :snowday, :swayze_or_oprah, :tap, :tap_y, :teamcity
136  #config.formatters = [:dot]
137
138  # Specify if you want color output from the formatters.
139  #config.color = true
140
141  # Teaspoon pipes all console[log/debug/error] to $stdout. This is useful to catch places where you've forgotten to
142  # remove them, but in verbose applications this may not be desirable.
143  #config.suppress_log = false
144
145  # COVERAGE REPORTS / THRESHOLD ASSERTIONS
146  #
147  # Coverage reports requires Istanbul (https://github.com/gotwarlost/istanbul) to add instrumentation to your code and
148  # display coverage statistics.
149  #
150  # Coverage configurations are similar to suites. You can define several, and use different ones under different
151  # conditions.
152  #
153  # To run with a specific coverage configuration
154  # - with the rake task: rake teaspoon USE_COVERAGE=[coverage_name]
155  # - with the cli: teaspoon --coverage=[coverage_name]
156
157  # Specify that you always want a coverage configuration to be used. Otherwise, specify that you want coverage
158  # on the CLI.
159  # Set this to "true" or the name of your coverage config.
160  #config.use_coverage = nil
161
162  # You can have multiple coverage configs by passing a name to config.coverage.
163  # e.g. config.coverage :ci do |coverage|
164  # The default coverage config name is :default.
165  config.coverage do |coverage|
166    # Which coverage reports Istanbul should generate. Correlates directly to what Istanbul supports.
167    #
168    # Available: text-summary, text, html, lcov, lcovonly, cobertura, teamcity
169    #coverage.reports = ["text-summary", "html"]
170
171    # The path that the coverage should be written to - when there's an artifact to write to disk.
172    # Note: Relative to `config.root`.
173    #coverage.output_path = "coverage"
174
175    # Assets to be ignored when generating coverage reports. Accepts an array of filenames or regular expressions. The
176    # default excludes assets from vendor, gems and support libraries.
177    #coverage.ignore = [%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]
178
179    # Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
180    # aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
181    #coverage.statements = nil
182    #coverage.functions = nil
183    #coverage.branches = nil
184    #coverage.lines = nil
185  end
186end