jasmine_junitxml_formatter 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/Gemfile +1 -0
- data/jasmine_junitxml_formatter.gemspec +16 -1
- data/lib/jasmine/formatters/junit_xml.rb +5 -0
- data/lib/jasmine_junitxml_formatter/version.rb +1 -1
- data/release_notes/1.2.0.md +10 -0
- data/spec/lib/jasmine/formatters/junit_xml_spec.rb +25 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 374cc416fc1bba2c677af48bfdcb327a56e4d8eb
|
4
|
+
data.tar.gz: 13e86c5b1c14741d9dfd1a87ba7b5c7d160f8772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef50fe7131d104d570faae58070e9a1733946972ebe6a183f19bb818194912ee01212c233ff0384203873fc68e8e1857085e8d445dfc118d3f1b7e48dc8a8360
|
7
|
+
data.tar.gz: b946e475c29c8d188fe18c80b46f120f4c7553ac95a8b28a6e72c6fa1691445f148a748f1a4a442e3b5b08ba6368932b2373b055ff2d6ed65139646b4c3ca968
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -3,6 +3,17 @@ lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'jasmine_junitxml_formatter/version'
|
5
5
|
|
6
|
+
def ruby_version_less_than(target_version)
|
7
|
+
version_parts = RUBY_VERSION.split('.').map(&:to_i).zip(target_version)
|
8
|
+
|
9
|
+
version_parts.each do |(current_part, target_part)|
|
10
|
+
if current_part < target_part
|
11
|
+
return true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
6
17
|
Gem::Specification.new do |spec|
|
7
18
|
spec.name = "jasmine_junitxml_formatter"
|
8
19
|
spec.version = JasmineJunitxmlFormatter::VERSION
|
@@ -23,5 +34,9 @@ Gem::Specification.new do |spec|
|
|
23
34
|
spec.add_development_dependency "rake"
|
24
35
|
|
25
36
|
spec.add_dependency 'jasmine', '~> 2.4'
|
26
|
-
|
37
|
+
if ruby_version_less_than([2,1,0])
|
38
|
+
spec.add_dependency 'nokogiri', '< 1.7.0'
|
39
|
+
else
|
40
|
+
spec.add_dependency 'nokogiri'
|
41
|
+
end
|
27
42
|
end
|
@@ -8,6 +8,7 @@ module Jasmine
|
|
8
8
|
@doc = Nokogiri::XML '<testsuites><testsuite name="Jasmine Suite"></testsuite></testsuites>', nil, 'UTF-8'
|
9
9
|
@spec_count = 0
|
10
10
|
@failure_count = 0
|
11
|
+
@pending_count = 0
|
11
12
|
end
|
12
13
|
|
13
14
|
def format(results)
|
@@ -29,6 +30,10 @@ module Jasmine
|
|
29
30
|
failure.content = failed_exp.stack
|
30
31
|
failure.parent = testcase
|
31
32
|
end
|
33
|
+
elsif result.pending?
|
34
|
+
@pending_count += 1
|
35
|
+
skipped = Nokogiri::XML::Node.new('skipped', doc)
|
36
|
+
skipped.parent = testcase
|
32
37
|
end
|
33
38
|
|
34
39
|
testcase.parent = testsuite
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Jasmine JUnit XML Reporter 1.2.0 Release Notes
|
2
|
+
|
3
|
+
## Issues and Pull Requests
|
4
|
+
|
5
|
+
* Support for skipped specs in JUnit output
|
6
|
+
- Merges [#6](https://github.com/jasmine/jasmine-npm/issues/6) from @tzar
|
7
|
+
|
8
|
+
------
|
9
|
+
|
10
|
+
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
@@ -48,6 +48,27 @@ describe Jasmine::Formatters::JunitXml do
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
+
describe 'when there are pending specs' do
|
52
|
+
it "shows the spec counts" do
|
53
|
+
results = [pending_result('fullName' => 'Pending test', 'description' => 'test')]
|
54
|
+
subject = Jasmine::Formatters::JunitXml.new
|
55
|
+
|
56
|
+
subject.format(results)
|
57
|
+
subject.done({})
|
58
|
+
xml = Nokogiri::XML(file_stub.content)
|
59
|
+
|
60
|
+
testsuite = xml.xpath('/testsuites/testsuite').first
|
61
|
+
expect(testsuite['tests']).to eq '1'
|
62
|
+
expect(testsuite['failures']).to eq '0'
|
63
|
+
expect(testsuite['name']).to eq 'Jasmine Suite'
|
64
|
+
|
65
|
+
expect(xml.xpath('//testcase').size).to eq 1
|
66
|
+
expect(xml.xpath('//testcase').first['classname']).to eq 'Pending'
|
67
|
+
expect(xml.xpath('//testcase').first['name']).to eq 'test'
|
68
|
+
expect(xml.xpath('//testcase/skipped').first).to_not eq(nil)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
51
72
|
describe 'when there are failures' do
|
52
73
|
it 'shows the spec counts' do
|
53
74
|
results1 = [passing_result]
|
@@ -190,4 +211,8 @@ YAML
|
|
190
211
|
def passing_result(options = {})
|
191
212
|
Jasmine::Result.new(passing_raw_result.merge(options))
|
192
213
|
end
|
214
|
+
|
215
|
+
def pending_result(options = {})
|
216
|
+
Jasmine::Result.new(pending_raw_result.merge(options))
|
217
|
+
end
|
193
218
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine_junitxml_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Van Hove
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- release_notes/0.3.0.md
|
106
106
|
- release_notes/1.0.0.md
|
107
107
|
- release_notes/1.1.0.md
|
108
|
+
- release_notes/1.2.0.md
|
108
109
|
- spec/lib/jasmine/formatters/junit_xml_spec.rb
|
109
110
|
- spec/spec_helper.rb
|
110
111
|
homepage: https://github.com/jasmine/jasmine_junitxml_formatter
|