2011-07-14 14:54:44 +00:00
|
|
|
describe 'HeadlessReporterResult', ->
|
2011-08-07 18:45:57 +00:00
|
|
|
|
2011-10-27 00:05:05 +00:00
|
|
|
describe 'jasmine.HeadlessConsoleReporter', ->
|
2011-08-07 18:45:57 +00:00
|
|
|
reporter = null
|
|
|
|
|
|
|
|
beforeEach ->
|
2011-10-27 00:05:05 +00:00
|
|
|
reporter = new jasmine.HeadlessConsoleReporter()
|
2011-08-07 18:45:57 +00:00
|
|
|
|
2011-12-12 17:22:32 +00:00
|
|
|
describe '#formatResultLine', ->
|
|
|
|
context 'length = 1', ->
|
|
|
|
it 'should format', ->
|
|
|
|
reporter.length = 1
|
|
|
|
expect(reporter.formatResultLine(0)).toMatch(/test,/)
|
|
|
|
|
|
|
|
context 'length != 1', ->
|
|
|
|
it 'should format', ->
|
|
|
|
reporter.length = 2
|
|
|
|
expect(reporter.formatResultLine(0)).toMatch(/tests,/)
|
|
|
|
|
|
|
|
context 'failedCount = 1', ->
|
|
|
|
it 'should format', ->
|
|
|
|
reporter.failedCount = 1
|
|
|
|
expect(reporter.formatResultLine(0)).toMatch(/failure,/)
|
|
|
|
|
|
|
|
context 'failedCount != 1', ->
|
|
|
|
it 'should format', ->
|
|
|
|
reporter.failedCount = 0
|
|
|
|
expect(reporter.formatResultLine(0)).toMatch(/failures,/)
|
|
|
|
|
|
|
|
context 'runtime = 1', ->
|
|
|
|
it 'should format', ->
|
|
|
|
expect(reporter.formatResultLine(1)).toMatch(/sec./)
|
|
|
|
|
|
|
|
context 'runtime != 1', ->
|
|
|
|
it 'should format', ->
|
|
|
|
expect(reporter.formatResultLine(0)).toMatch(/secs./)
|
2011-09-12 19:38:40 +00:00
|
|
|
|