Skip to content

Commit

Permalink
fix(config): make the config changes backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed Jun 28, 2013
1 parent 47c641f commit 593ad85
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,26 +168,32 @@ var CONST_ERR = '%s is not supported anymore.\n\tPlease use `frameworks = ["%s"]
[framework, framework + '_ADAPTER'].forEach(function(name) {
Object.defineProperty(global, name, {configurable: true, get: function() {
log.warn(CONST_ERR, name, framework.toLowerCase());
return __dirname + '/../../karma-' + framework.toLowerCase() + '/lib/' +
(framework === name ? framework.toLowerCase() : 'adapter') + '.js';
}});
});
});

['REQUIRE', 'REQUIRE_ADAPTER'].forEach(function(name) {
Object.defineProperty(global, name, {configurable: true, get: function() {
log.warn(CONST_ERR, name, 'requirejs');
return __dirname + '/../../karma-requirejs/lib/' +
(name === 'REQUIRE' ? 'require' : 'adapter') + '.js';
}});
});

['ANGULAR_SCENARIO', 'ANGULAR_SCENARIO_ADAPTER'].forEach(function(name) {
Object.defineProperty(global, name, {configurable: true, get: function() {
log.warn(CONST_ERR, name, 'ng-scenario');
return __dirname + '/../../karma-ng-scenario/lib/' +
(name === 'ANGULAR_SCENARIO' ? 'angular-scenario' : 'adapter') + '.js';
}});
});

['LOG_DISABLE', 'LOG_INFO', 'LOG_DEBUG', 'LOG_WARN', 'LOG_ERROR'].forEach(function(name) {
Object.defineProperty(global, name, {configurable: true, get: function() {
log.warn('%s is not supported anymore.\n Please use `karma.%s` instead.', name, name);
return constant.LOG_INFO;
return constant[name];
}});
});

Expand Down

0 comments on commit 593ad85

Please sign in to comment.