Skip to content

Commit

Permalink
test: add test that checks if duration is NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingmar Stein committed Jun 15, 2017
1 parent 6423d41 commit 7b1679f
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/unit/reporters/base-reporter-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,42 @@ describe 'BaseReporter', () ->

it 'should set the end time', () ->
assert.isOk tests[0].end

describe 'when passing test start is UTC string', () ->

beforeEach () ->
test =
status: 'pass'
title: 'Passing Test'
emitter.emit 'test start', test
test.start = '2017-06-15T09:29:50.588Z'
emitter.emit 'test pass', test

it 'should set the duration', () ->
assert.isNotNaN tests[0].duration

describe 'when failed test start is UTC string', () ->

beforeEach () ->
test =
status: 'pass'
title: 'Failed Test'
emitter.emit 'test start', test
test.start = '2017-06-15T09:29:50.588Z'
emitter.emit 'test fail', test

it 'should set the duration', () ->
assert.isNotNaN tests[0].duration

describe 'when errored test start is UTC string', () ->

beforeEach () ->
test =
status: 'pass'
title: 'Errored Test'
emitter.emit 'test start', test
test.start = '2017-06-15T09:29:50.588Z'
emitter.emit 'test error', new Error('Error'), test

it 'should set the duration', () ->
assert.isNotNaN tests[0].duration

0 comments on commit 7b1679f

Please sign in to comment.