From 7233c5fb9e1c105032000bbcb9afaddf72ccbc97 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Mon, 6 May 2013 10:30:35 -0700 Subject: [PATCH] feat(config): add warning if old constants are used To make upgrading to the new config syntax easier. --- lib/config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/config.js b/lib/config.js index 16ca69681..ff2eba886 100644 --- a/lib/config.js +++ b/lib/config.js @@ -160,6 +160,13 @@ var KarmaDsl = function(config) { }}); }); + ['LOG_DISABLE', 'LOG_INFO', 'LOG_DEBUG', 'LOG_WARN', 'LOG_ERROR'].forEach(function(name) { + Object.defineProperty(global, name, {get: function() { + log.warn('%s is not supported anymore.\n Please use `karma.%s` instead.', name, name); + return constant.LOG_INFO; + }}); + }); + this.configure = function(newConfig) { Object.keys(newConfig).forEach(function(key) { config[key] = newConfig[key];