Skip to content

Commit

Permalink
feat(config): add warning if old constants are used
Browse files Browse the repository at this point in the history
To make upgrading to the new config syntax easier.
  • Loading branch information
vojtajina committed May 6, 2013
1 parent 877f63c commit 7233c5f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 7233c5f

Please sign in to comment.