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

Commit

Permalink
fix: don't make assumptions about the input 'config' object
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek authored and kylef committed Jan 14, 2019
1 parent 81288f8 commit e9b76dd
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,16 @@ function applyConfiguration(config) {

configuration.options = applyLoggingOptions(configuration.options);

if (config.hooksData || config.options.b || config.options.sandbox) {
throw new Error('DEPRECATED: 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.");
if (config) {
if (config.hooksData
|| (config.options && (config.options.b || config.options.sandbox))) {
throw new Error('DEPRECATED: 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.");
}
}

return configuration;
Expand Down

0 comments on commit e9b76dd

Please sign in to comment.