Skip to content
Browse files

add unit tests for SC.Logger.debug

  • Loading branch information...
1 parent d1e5faf commit e9787727e811802a17bff8a943bc04e7417e9ff6 @hollow hollow committed with Charles Jolley
Showing with 12 additions and 1 deletion.
  1. +12 −1 frameworks/runtime/tests/system/logger.js
View
13 frameworks/runtime/tests/system/logger.js
@@ -13,6 +13,7 @@ function testConsole() {
return {
log: function() { return true; },
alert: function() { return true; },
+ debug: function() { return true; },
dir: function() { return true; },
dirxml: function() { return true; },
error: function() { return true; },
@@ -58,6 +59,16 @@ test("log", function() {
equals(SC.Logger.log("test"), true, "Function is null -- fallBackOnAlert true");
});
+test("debug", function() {
+ equals(SC.Logger.debug("Debug"), true, "Function is defined");
+
+ SC.Logger.get('reporter').debug = null;
+ equals(SC.Logger.debug("Debug"), true, "Function is null -- fallBackOnLog true");
+
+ SC.Logger.fallBackOnLog = false;
+ equals(SC.Logger.debug("Debug"), false, "Function is null -- fallBackOnLog false");
+});
+
test("dir", function() {
equals(SC.Logger.dir({test:"string"}), true, "Function is defined");
@@ -162,4 +173,4 @@ test("_argumentsToString", function() {
SC.LOGGER_LOG_DELIMITER = "|";
equals(SC.Logger._argumentsToString.apply(SC.Logger, ["test", "test2"]), "test|test2", "Formatting using custom delimiter");
-});
+});

0 comments on commit e978772

Please sign in to comment.
Something went wrong with that request. Please try again.