From a73f898bb9131e078c71ca7c903f8c0e637e7d16 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 8 Feb 2017 17:24:55 +0000 Subject: [PATCH] try to make mock-request logging saner --- spec/mock-request.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/mock-request.js b/spec/mock-request.js index bbd2e97f3..bf1a1b04e 100644 --- a/spec/mock-request.js +++ b/spec/mock-request.js @@ -49,17 +49,17 @@ HttpBackend.prototype = { const tryFlush = function() { // if there's more real requests and more expected requests, flush 'em. console.log( - " trying to flush queue => reqs=%s expected=%s [%s]", - self.requests.length, self.expectedRequests.length, path, + " trying to flush queue => reqs=[%s] expected=[%s]", + self.requests, self.expectedRequests.map((er) => er.path), ); if (self._takeFromQueue(path)) { // try again on the next tick. - console.log(" flushed. Trying for more. [%s]", path); flushed += 1; if (numToFlush && flushed === numToFlush) { - console.log(" [%s] Flushed assigned amount: %s", path, numToFlush); + console.log(" Flushed assigned amount: %s", numToFlush); defer.resolve(); } else { + console.log(" flushed. Trying for more."); setTimeout(tryFlush, 0); } } else if (flushed === 0 && !triedWaiting) { @@ -68,7 +68,7 @@ HttpBackend.prototype = { setTimeout(tryFlush, 5); triedWaiting = true; } else { - console.log(" no more flushes. [%s]", path); + console.log(" no more flushes."); defer.resolve(); } };