From 0741ac44f3e97952efefe64dc61b3547172d707c Mon Sep 17 00:00:00 2001 From: Simon Gaeremynck Date: Mon, 5 Nov 2012 15:17:46 +0000 Subject: [PATCH] Sorted the results in the json coverage reporter on their filename. --- lib/reporters/json-cov.js | 4 ++++ 1 file changed, 4 insertions(+) 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; }