From 4c88ed45f73449f84090a4aba1dfaaa1a129babc Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Mon, 17 Jun 2013 11:37:26 -0700 Subject: [PATCH] Imrove comments, clean intercept counter in logging package at the same place we reset the intercepted array. --- packages/logging/logging.js | 1 + packages/logging/logging_test.js | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/logging/logging.js b/packages/logging/logging.js index 83c1ed312a..42c3d99a8a 100644 --- a/packages/logging/logging.js +++ b/packages/logging/logging.js @@ -16,6 +16,7 @@ Log._intercept = function (count) { Log._intercepted = function () { var lines = interceptedLines; interceptedLines = []; + intercept = 0; return lines; }; diff --git a/packages/logging/logging_test.js b/packages/logging/logging_test.js index d8d50aa95c..16cc748f7e 100644 --- a/packages/logging/logging_test.js +++ b/packages/logging/logging_test.js @@ -108,12 +108,9 @@ Tinytest.add("logging - log", function (test) { }); }); - // Since everything above throws, it shouldn't print anything, - // It clears the intercepted array as well. + // Since all tests above should throw, nothing should be printed. + // This call will set the logging interception to the clean state as well. test.equal(Log._intercepted().length, 0); - // Put counter back to 0. - // It didn't move and empty intercepted list proves it. - Log._intercept(-throwingTestcases.length); }; logBothMessageAndObject(Log, 'info');