Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
refactor: do not use the word 'deprecated' as there's no deprecation …
Browse files Browse the repository at this point in the history
…period
  • Loading branch information
honzajavorek committed Feb 5, 2019
1 parent 01b042e commit 072ce78
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions lib/configuration.js
Original file line number Diff line number Diff line change
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 072ce78

Please sign in to comment.