Skip to content

Commit

Permalink
Fix: fix NaNms duration (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
IngmarStein committed Jun 14, 2017
1 parent 9981e14 commit 8abd8db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/reporters/base-reporter.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class BaseReporter
emitter.on 'test pass', (test) =>
@stats.passes += 1
test['end'] = new Date()
if typeof test['start'] is 'string'
test['start'] = new Date(test['start'])
test['duration'] = test.end - test.start

emitter.on 'test skip', (test) =>
Expand All @@ -35,11 +37,15 @@ class BaseReporter
emitter.on 'test fail', (test) =>
@stats.failures += 1
test['end'] = new Date()
if typeof test['start'] is 'string'
test['start'] = new Date(test['start'])
test['duration'] = test.end - test.start

emitter.on 'test error', (error, test) =>
@stats.errors += 1
test['end'] = new Date()
if typeof test['start'] is 'string'
test['start'] = new Date(test['start'])
test['duration'] = test.end - test.start


Expand Down

0 comments on commit 8abd8db

Please sign in to comment.