Imrove comments, clean intercept counter in logging package at the same

place we reset the intercepted array.
This commit is contained in:
Slava Kim
2013-06-17 11:37:26 -07:00
parent 4664722b71
commit 4c88ed45f7
2 changed files with 3 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ Log._intercept = function (count) {
Log._intercepted = function () {
var lines = interceptedLines;
interceptedLines = [];
intercept = 0;
return lines;
};

View File

@@ -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');