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.
@@ -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
- # Writes the result output to the console.
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
- @addErrors(@result) if @options.errors isnt 'never'
85
+ if @options.errors isnt 'never'
86
+ @addErrors(@result)
87
+ @addGlobalError(@result)
72
88
  @cleanResult(@result)
73
89
 
74
90
  @result