Skip to content

Commit

Permalink
refactor: do not use the word 'deprecated'
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek committed Feb 5, 2019
1 parent 01b042e commit bf5743a
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions lib/configuration.js
Expand Up @@ -44,40 +44,40 @@ function applyLoggingOptions(options) {
}


function deprecate(config = {}) {
function errorOnRemovedOptions(config = {}) {
if (config.options) {
if (config.options.c) {
throw new Error('DEPRECATED: Dredd does not support '
+ '-c anymore. Use --color/--no-color instead.');
throw new Error('Dredd does not support '
+ '-c anymore, use --color/--no-color instead');
}
if (typeof config.options.color === 'string') {
throw new Error('DEPRECATED: Dredd does not support '
+ `--color=${config.options.color} anymore. Use --color/--no-color instead.`);
throw new Error('Dredd does not support '
+ `--color=${config.options.color} anymore, use --color/--no-color instead`);
}
if (config.options.level) {
throw new Error('DEPRECATED: Dredd does not support '
+ '--level anymore. Use --loglevel instead.');
throw new Error('Dredd does not support '
+ '--level anymore, use --loglevel instead');
}
if (config.options.timestamp || config.options.t) {
throw new Error('DEPRECATED: Dredd does not support '
+ '--timestamp anymore. Use --loglevel=debug instead.');
throw new Error('Dredd does not support '
+ '--timestamp anymore, use --loglevel=debug instead');
}
if (config.options.silent || config.options.q) {
throw new Error('DEPRECATED: Dredd does not support '
+ '-q/--silent anymore. Use --loglevel=silent instead.');
throw new Error('Dredd does not support '
+ '-q/--silent anymore, use --loglevel=silent instead');
}
if (config.options.sandbox || config.options.b) {
throw new Error('DEPRECATED: Dredd does not support '
+ 'sandboxed JS hooks anymore. Use standard JS hooks instead.');
throw new Error('Dredd does not support '
+ 'sandboxed JS hooks anymore, use standard JS hooks instead');
}
}
if (config.hooksData) {
throw new Error('DEPRECATED: Dredd does not support '
+ 'sandboxed JS hooks anymore. Use standard JS hooks instead.');
throw new Error('Dredd does not support '
+ 'sandboxed JS hooks anymore, use standard JS hooks instead');
}
if (config.blueprintPath) {
throw new Error('DEPRECATED: Dredd does not support '
+ "the 'blueprintPath' option anymore. Use 'path' instead.");
throw new Error('Dredd does not support '
+ "the 'blueprintPath' option anymore, use 'path' instead");
}
}

Expand Down Expand Up @@ -150,7 +150,7 @@ function applyConfiguration(config) {
}

applyLoggingOptions(configuration.options);
deprecate(config);
errorOnRemovedOptions(config);

return configuration;
}
Expand Down

0 comments on commit bf5743a

Please sign in to comment.