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,14 +64,9 @@ class jasmine.GWT.Scenario extends jasmine.GWT.Background
|
||||
_this._name = name
|
||||
|
||||
runCode = (param, args = []) ->
|
||||
resultsIndex = jasmine.getEnv().currentSpec.results().getItems().length
|
||||
|
||||
it "#{type} #{name}", ->
|
||||
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
|
||||
|
||||
args = []
|
||||
|
||||
if param?
|
||||
|
@ -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