diff --git a/lib/reporters/json-cov.js b/lib/reporters/json-cov.js index 7eeab30e2d..73d0009377 100644 --- a/lib/reporters/json-cov.js +++ b/lib/reporters/json-cov.js @@ -80,6 +80,10 @@ function map(cov) { ret.sloc += data.sloc; } + ret.files.sort(function(a, b) { + return a.filename.localeCompare(b.filename); + }); + if (ret.sloc > 0) { ret.coverage = (ret.hits / ret.sloc) * 100; }