more prettifying, plus a JHW reporter
This commit is contained in:
parent
77d5a527f8
commit
f9ec7cb8ea
@ -56,7 +56,7 @@ class jasmine.GWT.Scenario extends jasmine.GWT.Background
|
||||
_this = this
|
||||
|
||||
describe @feature.name, ->
|
||||
it scenarioName, ->
|
||||
describe scenarioName, ->
|
||||
jasmine.GWT.runHook('Before', _this)
|
||||
|
||||
for [ type, name, param ] in _statements
|
||||
@ -64,13 +64,8 @@ class jasmine.GWT.Scenario extends jasmine.GWT.Background
|
||||
_this._name = name
|
||||
|
||||
runCode = (param, args = []) ->
|
||||
resultsIndex = jasmine.getEnv().currentSpec.results().getItems().length
|
||||
|
||||
param.apply(_this, args)
|
||||
|
||||
for index in [ resultsIndex...(jasmine.getEnv().currentSpec.results().getItems().length) ]
|
||||
result = jasmine.getEnv().currentSpec.results().getItems()[index]
|
||||
result.message = "[#{type} #{name}] " + result.message
|
||||
it "#{type} #{name}", ->
|
||||
param.apply(_this, args)
|
||||
|
||||
args = []
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
#= require jasmine.HeadlessReporter.Verbose
|
||||
|
||||
class jasmine.HeadlessReporter.VerboseGWT extends jasmine.HeadlessReporter.Verbose
|
||||
colorLine: (line, color) =>
|
||||
parts = line.split(' ')
|
||||
type = parts.shift()
|
||||
|
||||
switch type
|
||||
when 'Given'
|
||||
type.foreground('yellow') + ' ' + parts.join(' ').foreground(color)
|
||||
when 'When'
|
||||
type.foreground('cyan') + ' ' + parts.join(' ').foreground(color)
|
||||
when 'Then'
|
||||
type.foreground('magenta') + ' ' + parts.join(' ').foreground(color)
|
||||
else
|
||||
line.foreground(color)
|
Loading…
Reference in New Issue
Block a user