yui / grover

YUITest wrapper for PhantomJS

Home Page:http://yui.github.com/grover/lib/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'output' option generates incorrect / duplicate count.

gurumvg opened this issue · comments

The -o option generates incorrect / duplicate 'passed' count in the generated output file.

For example, running grover on the yui3 'cache' module as below will show the 'passed' count as 58 instead of the actual count which is 29.

grover tests/unit/cache.html -o ./cachle-results.json --json

The issue seems to be in the results normalizing code here. swapping the logic as below seem to resolve the issue.

if (data[key] && (typeof data[key] === 'number')) {
  data[key] += r[key];
}

if (!data[key]) {
  data[key] = r[key];
}

cc: @caridy , @davglass