diff --git a/src/js/coverageReceiverMiddleware.js b/src/js/coverageReceiverMiddleware.js index a0c38cc..7831bfc 100644 --- a/src/js/coverageReceiverMiddleware.js +++ b/src/js/coverageReceiverMiddleware.js @@ -46,8 +46,9 @@ gpii.testem.coverage.receiver.middlewareImpl = function (that, request, response var testPath = fluid.get(coveragePayload.document, "URL"); var testFilename = testPath ? testPath.split("/").pop() : "unknown"; + var timestamp = Date.now(); - var coverageFilename = ["coverage", "-", browser.name, "-", browser.version, "-", testFilename, "-", that.id, "-", Math.round(Math.random() * 10000), ".json"].join(""); + var coverageFilename = ["coverage", browser.name, browser.version, testFilename, that.id, timestamp].join("-") + ".json"; var coverageOutputPath = path.join(resolvedCoverageDir, coverageFilename); fs.writeFile(coverageOutputPath, JSON.stringify(coveragePayload.coverage, null, 2), { encoding: "utf8"}, function (error) {