diff --git a/README.md b/README.md index 915736a..d0d0e6d 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,14 @@ when this option is specified, and all loading becomes explicit. Files under directories named "support" are always loaded first. +#### support +Type: `String` + +Default: `''` + +Support files let you setup the environment in which steps will be run. If you are using steps option then you have to use support option as well (hooks etc.). + + #### tags Type: `String` or `Array` diff --git a/tasks/cucumber-js-task.js b/tasks/cucumber-js-task.js index 6c5d905..8ee70d7 100644 --- a/tasks/cucumber-js-task.js +++ b/tasks/cucumber-js-task.js @@ -11,8 +11,9 @@ module.exports = function (grunt) { var steps = grunt.option('steps') || options.steps; var tags = grunt.option('tags') || options.tags; var format = grunt.option('format') || options.format; - var modulePath = options.modulePath; - var coffee = options.coffee; + var support = grunt.option('support') || options.support; + var modulePath = grunt.option('modulePath') || options.modulePath; + var coffee = grunt.option('coffee') || options.coffee; grunt.verbose.writeflags(options, 'Options'); @@ -64,6 +65,11 @@ module.exports = function (grunt) { } } + if (! _.isEmpty(support)) { + execOptions.push('-r'); + execOptions.push(support); + } + if (! _.isEmpty(tags)) { if (typeof tags === "string") { tags = [tags];