jasmine 3.4.0 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +84 -0
- data/.gitignore +1 -1
- data/Gemfile +4 -7
- data/README.markdown +53 -10
- data/jasmine.gemspec +6 -3
- data/lib/jasmine/asset_expander.rb +20 -4
- data/lib/jasmine/ci_runner.rb +17 -2
- data/lib/jasmine/configuration.rb +2 -0
- data/lib/jasmine/dependencies.rb +8 -2
- data/lib/jasmine/formatters/console.rb +26 -6
- data/lib/jasmine/runners/chrome_headless.rb +34 -19
- data/lib/jasmine/runners/phantom_js.rb +1 -0
- data/lib/jasmine/tasks/jasmine.rake +5 -1
- data/lib/jasmine/version.rb +1 -1
- data/release_notes/3.5.0.md +16 -0
- data/release_notes/3.5.1.md +18 -0
- data/release_notes/3.6.0.md +31 -0
- data/release_notes/3.7.0.md +7 -0
- data/release_notes/3.8.0.md +38 -0
- data/spec/ci_runner_spec.rb +143 -0
- data/spec/configuration_spec.rb +13 -0
- data/spec/jasmine_rails_spec.rb +139 -148
- data/spec/lib/jasmine/formatters/console_spec.rb +54 -20
- data/spec/spec_helper.rb +21 -0
- metadata +33 -8
- data/.travis.yml +0 -32
@@ -13,28 +13,28 @@ describe Jasmine::Formatters::Console do
|
|
13
13
|
|
14
14
|
describe '#format' do
|
15
15
|
it 'prints a dot for a successful spec' do
|
16
|
-
formatter = Jasmine::Formatters::Console.new(outputter)
|
16
|
+
formatter = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
17
17
|
formatter.format([passing_result])
|
18
18
|
|
19
19
|
expect(outputter_output).to include('.')
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'prints a star for a pending spec' do
|
23
|
-
formatter = Jasmine::Formatters::Console.new(outputter)
|
23
|
+
formatter = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
24
24
|
formatter.format([pending_result])
|
25
25
|
|
26
26
|
expect(outputter_output).to include('*')
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'prints an F for a failing spec' do
|
30
|
-
formatter = Jasmine::Formatters::Console.new(outputter)
|
30
|
+
formatter = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
31
31
|
formatter.format([failing_result])
|
32
32
|
|
33
33
|
expect(outputter_output).to include('F')
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'prints a dot for a disabled spec' do
|
37
|
-
formatter = Jasmine::Formatters::Console.new(outputter)
|
37
|
+
formatter = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
38
38
|
formatter.format([disabled_result])
|
39
39
|
|
40
40
|
expect(outputter_output).to eq('')
|
@@ -44,7 +44,7 @@ describe Jasmine::Formatters::Console do
|
|
44
44
|
describe '#summary' do
|
45
45
|
it 'shows the failure messages' do
|
46
46
|
results = [failing_result, failing_result]
|
47
|
-
formatter = Jasmine::Formatters::Console.new(outputter)
|
47
|
+
formatter = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
48
48
|
formatter.format(results)
|
49
49
|
formatter.done(run_details)
|
50
50
|
expect(outputter_output).to match(/a suite with a failing spec/)
|
@@ -55,7 +55,7 @@ describe Jasmine::Formatters::Console do
|
|
55
55
|
describe 'when the full suite passes' do
|
56
56
|
it 'shows the spec counts' do
|
57
57
|
results = [passing_result]
|
58
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
58
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
59
59
|
console.format(results)
|
60
60
|
console.done(run_details)
|
61
61
|
|
@@ -65,7 +65,7 @@ describe Jasmine::Formatters::Console do
|
|
65
65
|
|
66
66
|
it 'shows the spec counts (pluralized)' do
|
67
67
|
results = [passing_result, passing_result]
|
68
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
68
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
69
69
|
console.format(results)
|
70
70
|
console.done(run_details)
|
71
71
|
|
@@ -77,7 +77,7 @@ describe Jasmine::Formatters::Console do
|
|
77
77
|
describe 'when there are failures' do
|
78
78
|
it 'shows the spec counts' do
|
79
79
|
results = [passing_result, failing_result]
|
80
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
80
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
81
81
|
console.format(results)
|
82
82
|
console.done(run_details)
|
83
83
|
|
@@ -87,7 +87,7 @@ describe Jasmine::Formatters::Console do
|
|
87
87
|
|
88
88
|
it 'shows the spec counts (pluralized)' do
|
89
89
|
results = [failing_result, failing_result]
|
90
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
90
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
91
91
|
console.format(results)
|
92
92
|
console.done(run_details)
|
93
93
|
|
@@ -97,7 +97,7 @@ describe Jasmine::Formatters::Console do
|
|
97
97
|
|
98
98
|
it 'shows the failure message' do
|
99
99
|
results = [failing_result]
|
100
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
100
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
101
101
|
console.format(results)
|
102
102
|
console.done(run_details)
|
103
103
|
|
@@ -108,7 +108,7 @@ describe Jasmine::Formatters::Console do
|
|
108
108
|
describe 'when there are pending specs' do
|
109
109
|
it 'shows the spec counts' do
|
110
110
|
results = [passing_result, pending_result]
|
111
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
111
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
112
112
|
console.format(results)
|
113
113
|
console.done(run_details)
|
114
114
|
|
@@ -117,7 +117,7 @@ describe Jasmine::Formatters::Console do
|
|
117
117
|
|
118
118
|
it 'shows the spec counts (pluralized)' do
|
119
119
|
results = [pending_result, pending_result]
|
120
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
120
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
121
121
|
console.format(results)
|
122
122
|
console.done(run_details)
|
123
123
|
|
@@ -126,7 +126,7 @@ describe Jasmine::Formatters::Console do
|
|
126
126
|
|
127
127
|
it 'shows the pending reason' do
|
128
128
|
results = [pending_result]
|
129
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
129
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
130
130
|
console.format(results)
|
131
131
|
console.done(run_details)
|
132
132
|
|
@@ -135,7 +135,7 @@ describe Jasmine::Formatters::Console do
|
|
135
135
|
|
136
136
|
it 'shows the default pending reason' do
|
137
137
|
results = [Jasmine::Result.new(pending_raw_result.merge('pendingReason' => ''))]
|
138
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
138
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
139
139
|
console.format(results)
|
140
140
|
console.done(run_details)
|
141
141
|
|
@@ -147,7 +147,7 @@ describe Jasmine::Formatters::Console do
|
|
147
147
|
|
148
148
|
it 'should not mention pending specs' do
|
149
149
|
results = [passing_result]
|
150
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
150
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
151
151
|
console.format(results)
|
152
152
|
console.done(run_details)
|
153
153
|
|
@@ -158,7 +158,7 @@ describe Jasmine::Formatters::Console do
|
|
158
158
|
describe 'when the tests were randomized' do
|
159
159
|
it 'should print a message with the seed' do
|
160
160
|
results = [passing_result]
|
161
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
161
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
162
162
|
console.format(results)
|
163
163
|
console.done({ 'order' => { 'random' => true, 'seed' => '4325' } })
|
164
164
|
|
@@ -168,7 +168,7 @@ describe Jasmine::Formatters::Console do
|
|
168
168
|
|
169
169
|
describe 'with loading errors' do
|
170
170
|
it 'should show the errors' do
|
171
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
171
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
172
172
|
console.done({ 'failedExpectations' => [
|
173
173
|
{
|
174
174
|
'globalErrorType' => 'load',
|
@@ -190,7 +190,7 @@ describe Jasmine::Formatters::Console do
|
|
190
190
|
|
191
191
|
describe 'with errors in a global afterAll' do
|
192
192
|
it 'should show the errors' do
|
193
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
193
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
194
194
|
console.done({ 'failedExpectations' => [
|
195
195
|
{
|
196
196
|
'globalErrorType' => 'afterAll',
|
@@ -212,7 +212,7 @@ describe Jasmine::Formatters::Console do
|
|
212
212
|
|
213
213
|
describe 'when the overall status is incomplete' do
|
214
214
|
it 'shows the reason' do
|
215
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
215
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
216
216
|
console.done({
|
217
217
|
'overallStatus' => 'incomplete',
|
218
218
|
'incompleteReason' => 'not all bars were frobnicated'
|
@@ -223,7 +223,7 @@ describe Jasmine::Formatters::Console do
|
|
223
223
|
end
|
224
224
|
|
225
225
|
it 'shows deprecation warnings' do
|
226
|
-
console = Jasmine::Formatters::Console.new(outputter)
|
226
|
+
console = Jasmine::Formatters::Console.new(double(:config, color: true), outputter)
|
227
227
|
console.format([Jasmine::Result.new(deprecation_raw_result)])
|
228
228
|
console.done({ 'deprecationWarnings' => [{ 'message' => 'globally deprecated', 'stack' => nil }] })
|
229
229
|
|
@@ -232,6 +232,40 @@ describe Jasmine::Formatters::Console do
|
|
232
232
|
end
|
233
233
|
end
|
234
234
|
|
235
|
+
describe 'enabling and disabling colorized output' do
|
236
|
+
context '.color_enabled controls whether it outputs with color or not' do
|
237
|
+
it 'prints colored outputs' do
|
238
|
+
config = double(:config, color: true)
|
239
|
+
|
240
|
+
formatter = Jasmine::Formatters::Console.new(config, outputter)
|
241
|
+
formatter.format([passing_result])
|
242
|
+
formatter.format([failing_result])
|
243
|
+
formatter.format([pending_result])
|
244
|
+
formatter.done(run_details)
|
245
|
+
|
246
|
+
expect(outputter_output).to include("\e[31m")
|
247
|
+
expect(outputter_output).to include("\e[32m")
|
248
|
+
expect(outputter_output).to include("\e[33m")
|
249
|
+
expect(outputter_output).to include("\e[0m")
|
250
|
+
end
|
251
|
+
|
252
|
+
it "doesn't print colored outputs" do
|
253
|
+
config = double(:config, color: false)
|
254
|
+
|
255
|
+
formatter = Jasmine::Formatters::Console.new(config, outputter)
|
256
|
+
formatter.format([passing_result])
|
257
|
+
formatter.format([failing_result])
|
258
|
+
formatter.format([pending_result])
|
259
|
+
formatter.done(run_details)
|
260
|
+
|
261
|
+
expect(outputter_output).not_to include("\e[31m")
|
262
|
+
expect(outputter_output).not_to include("\e[32m")
|
263
|
+
expect(outputter_output).not_to include("\e[33m")
|
264
|
+
expect(outputter_output).not_to include("\e[0m")
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
235
269
|
def failing_result
|
236
270
|
Jasmine::Result.new(failing_raw_result)
|
237
271
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -21,6 +21,27 @@ rescue Gem::LoadError
|
|
21
21
|
false
|
22
22
|
end
|
23
23
|
|
24
|
+
def rails_version
|
25
|
+
if ENV['RAILS_VERSION']
|
26
|
+
ENV['RAILS_VERSION']
|
27
|
+
else
|
28
|
+
'rails6' # keep in sync with default in gemspec
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def ruby_at_least?(version_str)
|
33
|
+
desired = version_str.split('.').map(&:to_i)
|
34
|
+
actual = RUBY_VERSION.split('.').map(&:to_i)
|
35
|
+
|
36
|
+
desired.zip(actual).each do |(d, a)|
|
37
|
+
if d != a
|
38
|
+
return d <= a
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
true
|
43
|
+
end
|
44
|
+
|
24
45
|
def create_temp_dir
|
25
46
|
tmp = File.join(Dir.tmpdir, "jasmine-gem-test_#{Time.now.to_f}")
|
26
47
|
FileUtils.rm_r(tmp, :force => true)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Van Hove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 7.0.0
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
29
|
+
version: '6'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 7.0.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rack-test
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +92,14 @@ dependencies:
|
|
86
92
|
requirements:
|
87
93
|
- - "~>"
|
88
94
|
- !ruby/object:Gem::Version
|
89
|
-
version: 3.
|
95
|
+
version: 3.8.0
|
90
96
|
type: :runtime
|
91
97
|
prerelease: false
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
93
99
|
requirements:
|
94
100
|
- - "~>"
|
95
101
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.
|
102
|
+
version: 3.8.0
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: rack
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +114,20 @@ dependencies:
|
|
108
114
|
- - ">="
|
109
115
|
- !ruby/object:Gem::Version
|
110
116
|
version: 1.2.1
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: webrick
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :runtime
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
111
131
|
- !ruby/object:Gem::Dependency
|
112
132
|
name: rake
|
113
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,10 +164,10 @@ executables:
|
|
144
164
|
extensions: []
|
145
165
|
extra_rdoc_files: []
|
146
166
|
files:
|
167
|
+
- ".circleci/config.yml"
|
147
168
|
- ".editorconfig"
|
148
169
|
- ".gitignore"
|
149
170
|
- ".rspec"
|
150
|
-
- ".travis.yml"
|
151
171
|
- Gemfile
|
152
172
|
- HOW_TO_TEST.markdown
|
153
173
|
- MIT.LICENSE
|
@@ -207,6 +227,11 @@ files:
|
|
207
227
|
- release_notes/3.2.0.md
|
208
228
|
- release_notes/3.3.0.md
|
209
229
|
- release_notes/3.4.0.md
|
230
|
+
- release_notes/3.5.0.md
|
231
|
+
- release_notes/3.5.1.md
|
232
|
+
- release_notes/3.6.0.md
|
233
|
+
- release_notes/3.7.0.md
|
234
|
+
- release_notes/3.8.0.md
|
210
235
|
- release_notes/v1.2.1.md
|
211
236
|
- release_notes/v1.3.2.md
|
212
237
|
- release_notes/v2.0.0.md
|
@@ -282,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
307
|
version: '0'
|
283
308
|
requirements: []
|
284
309
|
rubyforge_project:
|
285
|
-
rubygems_version: 2.6.
|
310
|
+
rubygems_version: 2.7.6.2
|
286
311
|
signing_key:
|
287
312
|
specification_version: 4
|
288
313
|
summary: JavaScript BDD framework
|
data/.travis.yml
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
cache: bundler
|
4
|
-
|
5
|
-
addons:
|
6
|
-
chrome: stable
|
7
|
-
|
8
|
-
rvm:
|
9
|
-
- "2.3"
|
10
|
-
- "2.4"
|
11
|
-
- "2.5"
|
12
|
-
- "2.6"
|
13
|
-
|
14
|
-
env:
|
15
|
-
- "RAILS_VERSION=rails5"
|
16
|
-
- "RAILS_VERSION=rails4"
|
17
|
-
- "RAILS_VERSION=pojs"
|
18
|
-
|
19
|
-
script: "if [ $PERFORMANCE_SPECS ];then bundle exec rake performance_specs --trace; else bundle exec rake --trace; fi"
|
20
|
-
|
21
|
-
matrix:
|
22
|
-
fast_finish: true
|
23
|
-
include:
|
24
|
-
- env:
|
25
|
-
- "PERFORMANCE_SPECS=true"
|
26
|
-
- "RAILS_VERSION=rails5"
|
27
|
-
|
28
|
-
before_install:
|
29
|
-
- "if [$RAILS_VERSION != rails4 ];then gem update --system; fi"
|
30
|
-
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
|
31
|
-
- "if [ $RAILS_VERSION = rails4 ];then gem install bundler -v '< 2.0' ; else gem install bundler; fi"
|
32
|
-
- bundle --version
|