guard-jasmine 1.3.0 → 1.19.2
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 +7 -0
- data/LICENSE +1 -1
- data/README.md +272 -93
- data/bin/guard-jasmine-debug +1 -1
- data/lib/guard/jasmine/cli.rb +180 -65
- data/lib/guard/jasmine/coverage.rb +69 -0
- data/lib/guard/jasmine/formatter.rb +3 -3
- data/lib/guard/jasmine/inspector.rb +1 -1
- data/lib/guard/jasmine/phantomjs/guard-jasmine.coffee +117 -34
- data/lib/guard/jasmine/phantomjs/guard-jasmine.js +246 -0
- data/lib/guard/jasmine/phantomjs/lib/console.js +9 -1
- data/lib/guard/jasmine/phantomjs/lib/junit_reporter.js +224 -0
- data/lib/guard/jasmine/phantomjs/lib/reporter.js +10 -3
- data/lib/guard/jasmine/phantomjs/lib/result.js +28 -1
- data/lib/guard/jasmine/phantomjs/src/reporter.coffee +6 -2
- data/lib/guard/jasmine/phantomjs/src/result.coffee +18 -2
- data/lib/guard/jasmine/runner.rb +382 -54
- data/lib/guard/jasmine/server.rb +106 -51
- data/lib/guard/jasmine/task.rb +1 -1
- data/lib/guard/jasmine/templates/Guardfile +4 -3
- data/lib/guard/jasmine/util.rb +33 -14
- data/lib/guard/jasmine/version.rb +1 -1
- data/lib/guard/jasmine.rb +75 -42
- metadata +42 -36
|
@@ -32,7 +32,7 @@ class ConsoleReporter
|
|
|
32
32
|
unless spec.results().skipped
|
|
33
33
|
specResult = {
|
|
34
34
|
id: spec.id
|
|
35
|
-
description: spec.description
|
|
35
|
+
description: '' + spec.description
|
|
36
36
|
passed: spec.results().failedCount is 0
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -54,7 +54,7 @@ class ConsoleReporter
|
|
|
54
54
|
suiteResult = {
|
|
55
55
|
id: suite.id
|
|
56
56
|
parent: suite.parentSuite?.id
|
|
57
|
-
description: suite.description
|
|
57
|
+
description: '' + suite.description
|
|
58
58
|
passed: suite.results().failedCount is 0
|
|
59
59
|
specs: @currentSpecs[suite.id] || []
|
|
60
60
|
suites: []
|
|
@@ -86,6 +86,10 @@ class ConsoleReporter
|
|
|
86
86
|
time: runtime
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
# Report coverage results if data present
|
|
90
|
+
if window.__coverage__
|
|
91
|
+
@runnerResult['coverage'] = window.__coverage__
|
|
92
|
+
|
|
89
93
|
# Delay the end runner message, so that logs and errors can be retreived in between
|
|
90
94
|
end = -> console.log "RUNNER_END"
|
|
91
95
|
setTimeout end, 10
|
|
@@ -45,6 +45,19 @@ class Result
|
|
|
45
45
|
|
|
46
46
|
suite
|
|
47
47
|
|
|
48
|
+
addGlobalError: (suite) ->
|
|
49
|
+
noSuites = !suite.suites || suite.suites.length == 0
|
|
50
|
+
noSpecs = !suite.specs || suite.specs.length == 0
|
|
51
|
+
globalErrors = @errors[-1] && @errors[-1].length != 0
|
|
52
|
+
|
|
53
|
+
if noSuites && noSpecs && globalErrors
|
|
54
|
+
err = @errors[-1][0]
|
|
55
|
+
errMsg = [ err.msg ]
|
|
56
|
+
for b in err.trace
|
|
57
|
+
errMsg.push "\n #{b.file}:#{b.line} #{b.function}"
|
|
58
|
+
suite.error = errMsg.join("")
|
|
59
|
+
suite.passed = false
|
|
60
|
+
|
|
48
61
|
# Clean unnecessary properties from the result
|
|
49
62
|
#
|
|
50
63
|
# @param [Object] suite the suite result
|
|
@@ -62,13 +75,16 @@ class Result
|
|
|
62
75
|
|
|
63
76
|
suite
|
|
64
77
|
|
|
65
|
-
#
|
|
78
|
+
# Processes the collected results and returns
|
|
79
|
+
# a single result object.
|
|
66
80
|
#
|
|
67
81
|
# @return [Object] the Jasmine result
|
|
68
82
|
#
|
|
69
83
|
process: ->
|
|
70
84
|
@addLogs(@result) if @options.console isnt 'never'
|
|
71
|
-
|
|
85
|
+
if @options.errors isnt 'never'
|
|
86
|
+
@addErrors(@result)
|
|
87
|
+
@addGlobalError(@result)
|
|
72
88
|
@cleanResult(@result)
|
|
73
89
|
|
|
74
90
|
@result
|