teaspoon 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT.LICENSE +1 -1
- data/README.md +46 -377
- data/app/assets/javascripts/teaspoon-jasmine.js +200 -194
- data/app/assets/javascripts/teaspoon-mocha.js +183 -185
- data/app/assets/javascripts/teaspoon-qunit.js +201 -193
- data/app/assets/javascripts/teaspoon-teaspoon.js +10 -10
- data/app/assets/javascripts/teaspoon/base/fixture.coffee +0 -1
- data/app/assets/javascripts/teaspoon/base/hook.coffee +7 -6
- data/app/assets/javascripts/teaspoon/qunit.coffee +10 -0
- data/app/controllers/teaspoon/suite_controller.rb +3 -4
- data/app/views/teaspoon/suite/_boot.html.erb +1 -1
- data/app/views/teaspoon/suite/_boot_require_js.html.erb +1 -0
- data/bin/teaspoon +1 -1
- data/config/routes.rb +4 -14
- data/lib/generators/teaspoon/install/install_generator.rb +22 -11
- data/lib/generators/teaspoon/install/templates/jasmine/{env_comments.rb → env_comments.rb.tt} +10 -5
- data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.coffee +5 -5
- data/lib/generators/teaspoon/install/templates/jasmine/spec_helper.js +5 -5
- data/lib/generators/teaspoon/install/templates/mocha/{env_comments.rb → env_comments.rb.tt} +10 -5
- data/lib/generators/teaspoon/install/templates/mocha/spec_helper.coffee +6 -5
- data/lib/generators/teaspoon/install/templates/mocha/spec_helper.js +6 -5
- data/lib/generators/teaspoon/install/templates/qunit/{env_comments.rb → env_comments.rb.tt} +10 -5
- data/lib/generators/teaspoon/install/templates/qunit/test_helper.coffee +5 -5
- data/lib/generators/teaspoon/install/templates/qunit/test_helper.js +5 -5
- data/lib/tasks/teaspoon.rake +1 -1
- data/lib/teaspoon/command_line.rb +37 -40
- data/lib/teaspoon/configuration.rb +27 -30
- data/lib/teaspoon/configuration.rb.orig +187 -0
- data/lib/teaspoon/console.rb +31 -17
- data/lib/teaspoon/coverage.rb +2 -3
- data/lib/teaspoon/deprecated.rb +13 -8
- data/lib/teaspoon/drivers/base.rb +2 -2
- data/lib/teaspoon/drivers/capybara_webkit_driver.rb +33 -0
- data/lib/teaspoon/drivers/phantomjs/runner.js +2 -2
- data/lib/teaspoon/drivers/phantomjs_driver.rb +13 -4
- data/lib/teaspoon/drivers/selenium_driver.rb +3 -5
- data/lib/teaspoon/engine.rb +33 -5
- data/lib/teaspoon/environment.rb +2 -4
- data/lib/teaspoon/exceptions.rb +8 -5
- data/lib/teaspoon/formatters/base.rb +39 -27
- data/lib/teaspoon/formatters/clean_formatter.rb +0 -1
- data/lib/teaspoon/formatters/description.rb +36 -0
- data/lib/teaspoon/formatters/documentation_formatter.rb +2 -2
- data/lib/teaspoon/formatters/json_formatter.rb +1 -2
- data/lib/teaspoon/formatters/junit_formatter.rb +20 -20
- data/lib/teaspoon/formatters/modules/report_module.rb +4 -4
- data/lib/teaspoon/formatters/pride_formatter.rb +0 -1
- data/lib/teaspoon/formatters/rspec_html_formatter.rb +463 -0
- data/lib/teaspoon/formatters/snowday_formatter.rb +0 -1
- data/lib/teaspoon/formatters/swayze_or_oprah_formatter.rb +5 -4
- data/lib/teaspoon/formatters/tap_formatter.rb +2 -3
- data/lib/teaspoon/formatters/tap_y_formatter.rb +20 -21
- data/lib/teaspoon/formatters/teamcity_formatter.rb +4 -5
- data/lib/teaspoon/instrumentation.rb +7 -7
- data/lib/teaspoon/result.rb +1 -3
- data/lib/teaspoon/runner.rb +1 -2
- data/lib/teaspoon/server.rb +2 -1
- data/lib/teaspoon/suite.rb +20 -17
- data/lib/teaspoon/utility.rb +1 -3
- data/lib/teaspoon/version.rb +1 -1
- data/spec/dummy/config/application.rb +14 -18
- data/spec/dummy/config/boot.rb +2 -6
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/config/environments/development.rb +27 -13
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +26 -13
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/features/console_reporter_spec.rb +3 -8
- data/spec/features/hooks_spec.rb +17 -4
- data/spec/features/html_reporter_spec.rb +12 -1
- data/spec/features/install_generator_spec.rb +2 -3
- data/spec/features/instrumentation_spec.rb +11 -11
- data/spec/javascripts/teaspoon/base/teaspoon_spec.coffee +14 -1
- data/spec/spec_helper.rb +7 -4
- data/spec/teaspoon/command_line_spec.rb +19 -28
- data/spec/teaspoon/configuration_spec.rb +22 -14
- data/spec/teaspoon/console_spec.rb +79 -63
- data/spec/teaspoon/coverage_spec.rb +23 -23
- data/spec/teaspoon/drivers/capybara_webkit_driver_spec.rb +39 -0
- data/spec/teaspoon/drivers/phantomjs_driver_spec.rb +10 -5
- data/spec/teaspoon/drivers/selenium_driver_spec.rb +10 -10
- data/spec/teaspoon/environment_spec.rb +28 -20
- data/spec/teaspoon/exceptions_spec.rb +4 -4
- data/spec/teaspoon/exporter_spec.rb +28 -28
- data/spec/teaspoon/formatters/base_spec.rb +29 -29
- data/spec/teaspoon/formatters/clean_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/documentation_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/dot_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/json_formatter_spec.rb +7 -7
- data/spec/teaspoon/formatters/junit_formatter_spec.rb +10 -10
- data/spec/teaspoon/formatters/pride_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/rspec_html_formatter_spec.rb +107 -0
- data/spec/teaspoon/formatters/snowday_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/tap_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/tap_y_formatter_spec.rb +1 -1
- data/spec/teaspoon/formatters/teamcity_formatter_spec.rb +27 -27
- data/spec/teaspoon/instrumentation_spec.rb +35 -29
- data/spec/teaspoon/result_spec.rb +40 -36
- data/spec/teaspoon/runner_spec.rb +23 -20
- data/spec/teaspoon/server_spec.rb +19 -16
- data/spec/teaspoon/suite_spec.rb +23 -9
- data/spec/teaspoon_env.rb +7 -12
- data/test/javascripts/teaspoon/qunit/models_test.coffee +6 -2
- data/vendor/assets/javascripts/support/chai-1.10.0.js +4800 -0
- data/vendor/assets/javascripts/support/chai-jq-0.0.7.js +524 -0
- data/vendor/assets/javascripts/support/chai.js +4435 -4349
- metadata +57 -54
- data/app/assets/javascripts/teaspoon-angular.js +0 -1299
- data/app/assets/javascripts/teaspoon/angular.coffee +0 -55
- data/app/assets/javascripts/teaspoon/angular/reporters/console.coffee +0 -11
- data/app/assets/javascripts/teaspoon/angular/reporters/html.coffee +0 -21
- data/spec/javascripts/angular_helper.coffee +0 -5
- data/spec/javascripts/teaspoon/angular/models_aspec.coffee +0 -95
- data/spec/javascripts/teaspoon/angular/reporters/html_aspec.coffee +0 -9
- data/vendor/assets/javascripts/angular/1.0.5.js +0 -26195
- data/vendor/assets/javascripts/angular/MIT-LICENSE +0 -22
@@ -1,10 +1,10 @@
|
|
1
1
|
(function() {
|
2
2
|
var TeaspoonInterface,
|
3
|
-
|
3
|
+
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
4
4
|
|
5
5
|
TeaspoonInterface = (function() {
|
6
6
|
function TeaspoonInterface() {
|
7
|
-
this.filter =
|
7
|
+
this.filter = bind(this.filter, this);
|
8
8
|
this.files = $u("#teaspoon-suite-list .file a");
|
9
9
|
this.input = $u("#teaspoon-filter-input")[0];
|
10
10
|
this.input.value = "";
|
@@ -12,18 +12,18 @@
|
|
12
12
|
}
|
13
13
|
|
14
14
|
TeaspoonInterface.prototype.filter = function() {
|
15
|
-
var file,
|
16
|
-
|
17
|
-
|
18
|
-
for (
|
19
|
-
file =
|
15
|
+
var file, i, len, ref, results;
|
16
|
+
ref = this.files;
|
17
|
+
results = [];
|
18
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
19
|
+
file = ref[i];
|
20
20
|
if (LiquidMetal.score(file.innerHTML, this.input.value) > 0) {
|
21
|
-
|
21
|
+
results.push(file.parentNode.style.display = "block");
|
22
22
|
} else {
|
23
|
-
|
23
|
+
results.push(file.parentNode.style.display = "none");
|
24
24
|
}
|
25
25
|
}
|
26
|
-
return
|
26
|
+
return results;
|
27
27
|
};
|
28
28
|
|
29
29
|
return TeaspoonInterface;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
Teaspoon.hook = (name,
|
2
|
-
|
1
|
+
Teaspoon.hook = (name, payload = {}) ->
|
2
|
+
method = "POST"
|
3
3
|
xhr = null
|
4
4
|
|
5
|
-
xhrRequest = (url,
|
5
|
+
xhrRequest = (url, payload, callback) ->
|
6
6
|
if window.XMLHttpRequest # Mozilla, Safari, ...
|
7
7
|
xhr = new XMLHttpRequest()
|
8
8
|
else if window.ActiveXObject # IE
|
@@ -13,9 +13,10 @@ Teaspoon.hook = (name, options = {}) ->
|
|
13
13
|
throw("Unable to make Ajax Request") unless xhr
|
14
14
|
|
15
15
|
xhr.onreadystatechange = callback
|
16
|
-
xhr.open(
|
17
|
-
xhr.
|
16
|
+
xhr.open("POST", "#{Teaspoon.root}/#{url}", false)
|
17
|
+
xhr.setRequestHeader("Content-Type", "application/json")
|
18
|
+
xhr.send(JSON.stringify(args: payload))
|
18
19
|
|
19
|
-
xhrRequest "#{Teaspoon.suites.active}/#{name}",
|
20
|
+
xhrRequest "#{Teaspoon.suites.active}/#{name}", payload, ->
|
20
21
|
return unless xhr.readyState == 4
|
21
22
|
throw("Unable to call hook \"#{url}\".") unless xhr.status == 200
|
@@ -33,6 +33,7 @@ class Teaspoon.Spec
|
|
33
33
|
return [] unless @spec.failed
|
34
34
|
for item in @spec.assertions
|
35
35
|
continue if item.result
|
36
|
+
@provideFallbackMessage(item)
|
36
37
|
{message: item.message, stack: item.source}
|
37
38
|
|
38
39
|
|
@@ -48,6 +49,15 @@ class Teaspoon.Spec
|
|
48
49
|
skipped: false
|
49
50
|
|
50
51
|
|
52
|
+
provideFallbackMessage: (item) ->
|
53
|
+
return if item.message
|
54
|
+
|
55
|
+
if item.actual && item.expected
|
56
|
+
item.message ||= "Expected #{JSON.stringify(item.actual)} to equal #{JSON.stringify(item.expected)}"
|
57
|
+
else
|
58
|
+
item.message = 'failed'
|
59
|
+
|
60
|
+
|
51
61
|
|
52
62
|
class Teaspoon.Suite
|
53
63
|
|
@@ -1,6 +1,4 @@
|
|
1
1
|
class Teaspoon::SuiteController < ActionController::Base
|
2
|
-
helper Teaspoon::SuiteHelper rescue nil
|
3
|
-
|
4
2
|
before_filter :prepend_fixture_paths
|
5
3
|
|
6
4
|
layout false
|
@@ -14,12 +12,13 @@ class Teaspoon::SuiteController < ActionController::Base
|
|
14
12
|
end
|
15
13
|
|
16
14
|
def hook
|
17
|
-
Teaspoon::Suite.new(params).hooks[params[:hook].to_s]
|
15
|
+
hooks = Teaspoon::Suite.new(params).hooks[params[:hook].to_s]
|
16
|
+
hooks.each { |hook| hook.call(params[:args]) }
|
18
17
|
render nothing: true
|
19
18
|
end
|
20
19
|
|
21
20
|
def fixtures
|
22
|
-
render "/#{params[:filename]}"
|
21
|
+
render template: "/#{params[:filename]}"
|
23
22
|
end
|
24
23
|
|
25
24
|
private
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<%
|
2
2
|
rails_config = Rails.application.config
|
3
3
|
require_options = {baseUrl: rails_config.assets.prefix}
|
4
|
+
require_options.merge!(urlArgs: "instrument=1", waitSeconds: 0) if Teaspoon.configuration.use_coverage
|
4
5
|
require_options.merge!(rails_config.requirejs.user_config) if rails_config.respond_to?(:requirejs)
|
5
6
|
specs = @suite.spec_assets(false).map{ |s| "#{s.gsub(/\.js.*$/, "")}" }
|
6
7
|
%>
|
data/bin/teaspoon
CHANGED
data/config/routes.rb
CHANGED
@@ -1,16 +1,6 @@
|
|
1
1
|
Teaspoon::Engine.routes.draw do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
match "
|
6
|
-
to: "suite#fixtures", via: [:get]
|
7
|
-
|
8
|
-
match "/:suite", as: "suite",
|
9
|
-
to: "suite#show", via: [:get],
|
10
|
-
defaults: { suite: "default" }
|
11
|
-
|
12
|
-
match "/:suite/:hook", as: "suite_hook",
|
13
|
-
to: "suite#hook", via: [:get, :post],
|
14
|
-
defaults: { suite: "default", hook: "default" }
|
15
|
-
|
2
|
+
root to: "suite#index"
|
3
|
+
match "/fixtures/*filename", to: "suite#fixtures", via: :get
|
4
|
+
match "/:suite", as: "suite", to: "suite#show", via: :get, defaults: { suite: "default" }
|
5
|
+
match "/:suite/:hook", as: "suite_hook", to: "suite#hook", via: :post, defaults: { suite: "default", hook: "default" }
|
16
6
|
end
|
@@ -1,40 +1,48 @@
|
|
1
1
|
module Teaspoon
|
2
2
|
module Generators
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
4
|
-
|
5
4
|
source_root File.expand_path("../", __FILE__)
|
6
5
|
|
7
6
|
desc "Installs the Teaspoon initializer into your application."
|
8
7
|
|
9
|
-
class_option :framework,
|
8
|
+
class_option :framework,
|
9
|
+
type: :string,
|
10
10
|
aliases: "-t",
|
11
11
|
default: "jasmine",
|
12
12
|
desc: "Specify which test framework to use (Available: jasmine, mocha, or qunit)"
|
13
13
|
|
14
|
-
class_option :coffee,
|
14
|
+
class_option :coffee,
|
15
|
+
type: :boolean,
|
15
16
|
aliases: "-c",
|
16
17
|
default: false,
|
17
18
|
desc: "Generate a CoffeeScript spec helper instead of Javascript"
|
18
19
|
|
19
|
-
class_option :no_comments,
|
20
|
+
class_option :no_comments,
|
21
|
+
type: :boolean,
|
20
22
|
aliases: "-q",
|
21
23
|
default: false,
|
22
24
|
desc: "Install the teaspoon_env.rb without comments"
|
23
25
|
|
24
|
-
class_option :partials,
|
26
|
+
class_option :partials,
|
27
|
+
type: :boolean,
|
25
28
|
aliases: "-p",
|
26
29
|
default: false,
|
27
30
|
desc: "Copy the boot and body partials"
|
28
31
|
|
29
32
|
def validate_framework
|
30
33
|
return if frameworks.include?(options[:framework])
|
31
|
-
puts "Unknown framework -- available #{frameworks.join(
|
34
|
+
puts "Unknown framework -- available #{frameworks.join(', ')}"
|
32
35
|
exit(1)
|
33
36
|
end
|
34
37
|
|
35
38
|
def copy_environment
|
36
|
-
|
37
|
-
|
39
|
+
if options[:no_comments]
|
40
|
+
copy_file "templates/#{framework}/env.rb",
|
41
|
+
"#{framework_type}/teaspoon_env.rb"
|
42
|
+
else
|
43
|
+
template "templates/#{framework}/env_comments.rb.tt",
|
44
|
+
"#{framework_type}/teaspoon_env.rb"
|
45
|
+
end
|
38
46
|
end
|
39
47
|
|
40
48
|
def create_structure
|
@@ -43,13 +51,16 @@ module Teaspoon
|
|
43
51
|
end
|
44
52
|
|
45
53
|
def copy_spec_helper
|
46
|
-
copy_file "templates/#{framework}/#{framework_type}_helper.#{helper_ext}",
|
54
|
+
copy_file "templates/#{framework}/#{framework_type}_helper.#{helper_ext}",
|
55
|
+
"#{framework_type}/javascripts/#{framework_type}_helper.#{helper_ext}"
|
47
56
|
end
|
48
57
|
|
49
58
|
def copy_partials
|
50
59
|
return unless options[:partials]
|
51
|
-
copy_file "templates/_boot.html.erb",
|
52
|
-
|
60
|
+
copy_file "templates/_boot.html.erb",
|
61
|
+
"#{framework_type}/javascripts/fixtures/_boot.html.erb"
|
62
|
+
copy_file "templates/_body.html.erb",
|
63
|
+
"#{framework_type}/javascripts/fixtures/_body.html.erb"
|
53
64
|
end
|
54
65
|
|
55
66
|
def display_readme
|
data/lib/generators/teaspoon/install/templates/jasmine/{env_comments.rb → env_comments.rb.tt}
RENAMED
@@ -41,7 +41,7 @@ Teaspoon.configure do |config|
|
|
41
41
|
# directives.
|
42
42
|
# Note: If no version is specified, the latest is assumed.
|
43
43
|
#
|
44
|
-
# Available: jasmine[1.3.1
|
44
|
+
# Available: jasmine[1.3.1], mocha[1.10.0, 1.17.1] qunit[1.12.0, 1.14.0]
|
45
45
|
suite.use_framework :jasmine, "1.3.1"
|
46
46
|
|
47
47
|
# Specify a file matcher as a regular expression and all matching files will be loaded when the suite is run. These
|
@@ -80,6 +80,11 @@ Teaspoon.configure do |config|
|
|
80
80
|
# synchronous Ajax request to the server that will call all of the blocks you've defined for that hook name.
|
81
81
|
#suite.hook :fixtures, proc{ }
|
82
82
|
|
83
|
+
# Determine whether specs loaded into the test harness should be embedded as individual script tags or concatenated
|
84
|
+
# into a single file. Similar to Rails' asset `debug: true` and `config.assets.debug = true` options. By default,
|
85
|
+
# Teaspoon expands all assets to provide more valuable stack traces that reference individual source files.
|
86
|
+
#suite.expand_assets = false
|
87
|
+
|
83
88
|
end
|
84
89
|
|
85
90
|
# Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
|
@@ -134,8 +139,8 @@ Teaspoon.configure do |config|
|
|
134
139
|
# Specify the formatters to use when outputting the results.
|
135
140
|
# Note: Output files can be specified by using `"junit>/path/to/output.xml"`.
|
136
141
|
#
|
137
|
-
# Available:
|
138
|
-
#config.formatters = ["
|
142
|
+
# Available: <%= Teaspoon::Formatters.known_formatters.map(&:name).join ", " %>
|
143
|
+
#config.formatters = ["<%= Teaspoon::Formatters.known_formatters.select(&:default?).first.name %>"]
|
139
144
|
|
140
145
|
# Specify if you want color output from the formatters.
|
141
146
|
#config.color = true
|
@@ -161,14 +166,14 @@ Teaspoon.configure do |config|
|
|
161
166
|
|
162
167
|
config.coverage do |coverage|
|
163
168
|
|
164
|
-
# Which coverage reports
|
169
|
+
# Which coverage reports Istanbul should generate. Correlates directly to what Istanbul supports.
|
165
170
|
#
|
166
171
|
# Available: text-summary, text, html, lcov, lcovonly, cobertura, teamcity
|
167
172
|
#coverage.reports = ["text-summary", "html"]
|
168
173
|
|
169
174
|
# The path that the coverage should be written to - when there's an artifact to write to disk.
|
170
175
|
# Note: Relative to `config.root`.
|
171
|
-
#coverage.
|
176
|
+
#coverage.output_path = "coverage"
|
172
177
|
|
173
178
|
# Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
|
174
179
|
# aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
|
@@ -8,6 +8,10 @@
|
|
8
8
|
# Use this polyfill to avoid the confusion.
|
9
9
|
#= require support/bind-poly
|
10
10
|
#
|
11
|
+
# You can require your own javascript files here. By default this will include everything in application, however you
|
12
|
+
# may get better load performance if you require the specific files that are being used in the spec that tests them.
|
13
|
+
#= require application
|
14
|
+
#
|
11
15
|
# Deferring execution
|
12
16
|
# If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
13
17
|
# Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
|
@@ -18,14 +22,10 @@
|
|
18
22
|
# Matching files
|
19
23
|
# By default Teaspoon will look for files that match _spec.{js,js.coffee,.coffee}. Add a filename_spec.js file in your
|
20
24
|
# spec path and it'll be included in the default suite automatically. If you want to customize suites, check out the
|
21
|
-
# configuration in
|
25
|
+
# configuration in teaspoon_env.rb
|
22
26
|
#
|
23
27
|
# Manifest
|
24
28
|
# If you'd rather require your spec files manually (to control order for instance) you can disable the suite matcher in
|
25
29
|
# the configuration and use this file as a manifest.
|
26
30
|
#
|
27
31
|
# For more information: http://github.com/modeset/teaspoon
|
28
|
-
#
|
29
|
-
# You can require your own javascript files here. By default this will include everything in application, however you
|
30
|
-
# may get better load performance if you require the specific files that are being used in the spec that tests them.
|
31
|
-
#= require application
|
@@ -8,6 +8,10 @@
|
|
8
8
|
// Use this polyfill to avoid the confusion.
|
9
9
|
//= require support/bind-poly
|
10
10
|
//
|
11
|
+
// You can require your own javascript files here. By default this will include everything in application, however you
|
12
|
+
// may get better load performance if you require the specific files that are being used in the spec that tests them.
|
13
|
+
//= require application
|
14
|
+
//
|
11
15
|
// Deferring execution
|
12
16
|
// If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
13
17
|
// Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
|
@@ -18,14 +22,10 @@
|
|
18
22
|
// Matching files
|
19
23
|
// By default Teaspoon will look for files that match _spec.{js,js.coffee,.coffee}. Add a filename_spec.js file in your
|
20
24
|
// spec path and it'll be included in the default suite automatically. If you want to customize suites, check out the
|
21
|
-
// configuration in
|
25
|
+
// configuration in teaspoon_env.rb
|
22
26
|
//
|
23
27
|
// Manifest
|
24
28
|
// If you'd rather require your spec files manually (to control order for instance) you can disable the suite matcher in
|
25
29
|
// the configuration and use this file as a manifest.
|
26
30
|
//
|
27
31
|
// For more information: http://github.com/modeset/teaspoon
|
28
|
-
//
|
29
|
-
// You can require your own javascript files here. By default this will include everything in application, however you
|
30
|
-
// may get better load performance if you require the specific files that are being used in the spec that tests them.
|
31
|
-
//= require application
|
@@ -41,7 +41,7 @@ Teaspoon.configure do |config|
|
|
41
41
|
# directives.
|
42
42
|
# Note: If no version is specified, the latest is assumed.
|
43
43
|
#
|
44
|
-
# Available: jasmine[1.3.1
|
44
|
+
# Available: jasmine[1.3.1], mocha[1.10.0, 1.17.1] qunit[1.12.0, 1.14.0]
|
45
45
|
suite.use_framework :mocha
|
46
46
|
|
47
47
|
# Specify a file matcher as a regular expression and all matching files will be loaded when the suite is run. These
|
@@ -80,6 +80,11 @@ Teaspoon.configure do |config|
|
|
80
80
|
# synchronous Ajax request to the server that will call all of the blocks you've defined for that hook name.
|
81
81
|
#suite.hook :fixtures, proc{ }
|
82
82
|
|
83
|
+
# Determine whether specs loaded into the test harness should be embedded as individual script tags or concatenated
|
84
|
+
# into a single file. Similar to Rails' asset `debug: true` and `config.assets.debug = true` options. By default,
|
85
|
+
# Teaspoon expands all assets to provide more valuable stack traces that reference individual source files.
|
86
|
+
#suite.expand_assets = false
|
87
|
+
|
83
88
|
end
|
84
89
|
|
85
90
|
# Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
|
@@ -134,8 +139,8 @@ Teaspoon.configure do |config|
|
|
134
139
|
# Specify the formatters to use when outputting the results.
|
135
140
|
# Note: Output files can be specified by using `"junit>/path/to/output.xml"`.
|
136
141
|
#
|
137
|
-
# Available:
|
138
|
-
#config.formatters = ["
|
142
|
+
# Available: <%= Teaspoon::Formatters.known_formatters.map(&:name).join ", " %>
|
143
|
+
#config.formatters = ["<%= Teaspoon::Formatters.known_formatters.select(&:default?).first.name %>"]
|
139
144
|
|
140
145
|
# Specify if you want color output from the formatters.
|
141
146
|
#config.color = true
|
@@ -161,14 +166,14 @@ Teaspoon.configure do |config|
|
|
161
166
|
|
162
167
|
config.coverage do |coverage|
|
163
168
|
|
164
|
-
# Which coverage reports
|
169
|
+
# Which coverage reports Istanbul should generate. Correlates directly to what Istanbul supports.
|
165
170
|
#
|
166
171
|
# Available: text-summary, text, html, lcov, lcovonly, cobertura, teamcity
|
167
172
|
#coverage.reports = ["text-summary", "html"]
|
168
173
|
|
169
174
|
# The path that the coverage should be written to - when there's an artifact to write to disk.
|
170
175
|
# Note: Relative to `config.root`.
|
171
|
-
#coverage.
|
176
|
+
#coverage.output_path = "coverage"
|
172
177
|
|
173
178
|
# Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
|
174
179
|
# aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
|
@@ -2,12 +2,17 @@
|
|
2
2
|
# require support/expect
|
3
3
|
# require support/sinon
|
4
4
|
# require support/chai
|
5
|
+
# require support/chai-jq-0.0.7
|
5
6
|
# require support/your-support-file
|
6
7
|
#
|
7
8
|
# PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
8
9
|
# Use this polyfill to avoid the confusion.
|
9
10
|
#= require support/bind-poly
|
10
11
|
#
|
12
|
+
# You can require your own javascript files here. By default this will include everything in application, however you
|
13
|
+
# may get better load performance if you require the specific files that are being used in the spec that tests them.
|
14
|
+
#= require application
|
15
|
+
#
|
11
16
|
# Deferring execution
|
12
17
|
# If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
13
18
|
# Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
|
@@ -18,7 +23,7 @@
|
|
18
23
|
# Matching files
|
19
24
|
# By default Teaspoon will look for files that match _spec.{js,js.coffee,.coffee}. Add a filename_spec.js file in your
|
20
25
|
# spec path and it'll be included in the default suite automatically. If you want to customize suites, check out the
|
21
|
-
# configuration in
|
26
|
+
# configuration in teaspoon_env.rb
|
22
27
|
#
|
23
28
|
# Manifest
|
24
29
|
# If you'd rather require your spec files manually (to control order for instance) you can disable the suite matcher in
|
@@ -33,7 +38,3 @@
|
|
33
38
|
# window.assert = chai.assert
|
34
39
|
# window.expect = chai.expect
|
35
40
|
# window.should = chai.should()
|
36
|
-
#
|
37
|
-
# You can require your own javascript files here. By default this will include everything in application, however you
|
38
|
-
# may get better load performance if you require the specific files that are being used in the spec that tests them.
|
39
|
-
#= require application
|
@@ -2,12 +2,17 @@
|
|
2
2
|
// require support/expect
|
3
3
|
// require support/sinon
|
4
4
|
// require support/chai
|
5
|
+
// require support/chai-jq-0.0.7
|
5
6
|
// require support/your-support-file
|
6
7
|
//
|
7
8
|
// PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
8
9
|
// Use this polyfill to avoid the confusion.
|
9
10
|
//= require support/bind-poly
|
10
11
|
//
|
12
|
+
// You can require your own javascript files here. By default this will include everything in application, however you
|
13
|
+
// may get better load performance if you require the specific files that are being used in the spec that tests them.
|
14
|
+
//= require application
|
15
|
+
//
|
11
16
|
// Deferring execution
|
12
17
|
// If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
13
18
|
// Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
|
@@ -18,7 +23,7 @@
|
|
18
23
|
// Matching files
|
19
24
|
// By default Teaspoon will look for files that match _spec.{js,js.coffee,.coffee}. Add a filename_spec.js file in your
|
20
25
|
// spec path and it'll be included in the default suite automatically. If you want to customize suites, check out the
|
21
|
-
// configuration in
|
26
|
+
// configuration in teaspoon_env.rb
|
22
27
|
//
|
23
28
|
// Manifest
|
24
29
|
// If you'd rather require your spec files manually (to control order for instance) you can disable the suite matcher in
|
@@ -33,7 +38,3 @@
|
|
33
38
|
// window.assert = chai.assert;
|
34
39
|
// window.expect = chai.expect;
|
35
40
|
// window.should = chai.should();
|
36
|
-
//
|
37
|
-
// You can require your own javascript files here. By default this will include everything in application, however you
|
38
|
-
// may get better load performance if you require the specific files that are being used in the spec that tests them.
|
39
|
-
//= require application
|