jasmine_junitxml_formatter 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 116523ec10aec3fe402767db61d485f779b238b8
|
4
|
+
data.tar.gz: b306eddedd2e9466d9caf2e0b66d8de2d207d2fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c640d2772d0d9f9fd8ef85115388213d6a4082a351a003d4ca5594060ed15054dc08e7bc3b40727849c5ae76b9435b143aa5d92203efe11862033145103a26f
|
7
|
+
data.tar.gz: 6b5af9acd5ec804227ac97162e615a57e4c9bd2f87f848afa1396f7aeb8fa80f30ffc6c6c04f199ecb3a6008de41125ded6cc5975f5412aaae5d3f7b1c98461a
|
@@ -17,6 +17,7 @@ module Jasmine
|
|
17
17
|
|
18
18
|
results.each do |result|
|
19
19
|
testcase = Nokogiri::XML::Node.new 'testcase', doc
|
20
|
+
testcase['classname'] = result.suite_name
|
20
21
|
testcase['name'] = result.description
|
21
22
|
|
22
23
|
if result.failed?
|
@@ -55,6 +56,23 @@ module Jasmine
|
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
59
|
+
global_failures = run_details.fetch('failedExpectations', [])
|
60
|
+
if global_failures.size > 0
|
61
|
+
@failure_count += 1
|
62
|
+
testcase = Nokogiri::XML::Node.new 'testcase', doc
|
63
|
+
testcase['name'] = 'Failure in afterAll'
|
64
|
+
|
65
|
+
global_failures.each do |failed_expectation|
|
66
|
+
failure = Nokogiri::XML::Node.new 'failure', doc
|
67
|
+
failure['message'] = failed_expectation['message']
|
68
|
+
failure['type'] = 'Failure'
|
69
|
+
failure.content = failed_expectation['stack']
|
70
|
+
failure.parent = testcase
|
71
|
+
end
|
72
|
+
|
73
|
+
testcase.parent = testsuite
|
74
|
+
end
|
75
|
+
|
58
76
|
testsuite['tests'] = @spec_count
|
59
77
|
testsuite['failures'] = @failure_count
|
60
78
|
testsuite['errors'] = 0
|
data/release_notes/1.0.0.md
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Jasmine JUnit XML Reporter 1.1.0 Release Notes
|
2
|
+
|
3
|
+
## Changes
|
4
|
+
|
5
|
+
* Add failures from an afterAll to the xml
|
6
|
+
|
7
|
+
## Pull Requests & Issues
|
8
|
+
|
9
|
+
* Set the suite_name as the classname attribute
|
10
|
+
- Fixes [#3](https://github.com/jasmine/jasmine_junitxml_formatter/issues/3)
|
11
|
+
- Merges [#4](https://github.com/jasmine/jasmine_junitxml_formatter/issues/4) from @DexterTheDragon
|
12
|
+
|
13
|
+
|
14
|
+
------
|
15
|
+
|
16
|
+
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
@@ -43,6 +43,7 @@ describe Jasmine::Formatters::JunitXml do
|
|
43
43
|
expect(testsuite['name']).to eq 'Jasmine Suite'
|
44
44
|
|
45
45
|
expect(xml.xpath('//testcase').size).to eq 1
|
46
|
+
expect(xml.xpath('//testcase').first['classname']).to eq 'Passing'
|
46
47
|
expect(xml.xpath('//testcase').first['name']).to eq 'test'
|
47
48
|
end
|
48
49
|
end
|
@@ -70,6 +71,25 @@ describe Jasmine::Formatters::JunitXml do
|
|
70
71
|
end
|
71
72
|
end
|
72
73
|
|
74
|
+
describe 'when there are failures in jasmineDone from a global afterAll' do
|
75
|
+
it 'adds a failing testcase node' do
|
76
|
+
subject = Jasmine::Formatters::JunitXml.new
|
77
|
+
|
78
|
+
subject.done({ 'failedExpectations' => [{ 'message' => 'Failure Message', 'stack' => 'failure stack' }] })
|
79
|
+
xml = Nokogiri::XML(file_stub.content)
|
80
|
+
|
81
|
+
expect(xml.xpath('/testsuites/testsuite').size).to eq(1)
|
82
|
+
testsuite = xml.xpath('/testsuites/testsuite').first
|
83
|
+
expect(testsuite['tests']).to eq '0'
|
84
|
+
expect(testsuite['failures']).to eq '1'
|
85
|
+
|
86
|
+
expect(xml.xpath('//testcase').size).to eq 1
|
87
|
+
expect(xml.xpath('//testcase/failure').size).to eq 1
|
88
|
+
expect(xml.xpath('//testcase/failure').first['message']).to eq 'Failure Message'
|
89
|
+
expect(xml.xpath('//testcase/failure').first.content).to eq 'failure stack'
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
73
93
|
describe 'with randomization information' do
|
74
94
|
it 'includes randomization seed when randomized' do
|
75
95
|
subject.format([])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.1.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: 2017-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- lib/jasmine_junitxml_formatter/version.rb
|
105
105
|
- release_notes/0.3.0.md
|
106
106
|
- release_notes/1.0.0.md
|
107
|
+
- release_notes/1.1.0.md
|
107
108
|
- spec/lib/jasmine/formatters/junit_xml_spec.rb
|
108
109
|
- spec/spec_helper.rb
|
109
110
|
homepage: https://github.com/jasmine/jasmine_junitxml_formatter
|