From 62bdcc9bc5899f5b8910b5b73746cc874e7bb000 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 19 Nov 2014 20:29:48 +0100 Subject: [PATCH] add support option --- README.md | 8 ++++++++ tasks/cucumber-js-task.js | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index a1ec8b9..852b22f 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` diff --git a/tasks/cucumber-js-task.js b/tasks/cucumber-js-task.js index 45e37a7..a326f77 100644 --- a/tasks/cucumber-js-task.js +++ b/tasks/cucumber-js-task.js @@ -9,6 +9,7 @@ module.exports = function (grunt) { var options = this.options(); var steps = options.steps; + var support = options.support; var tags = options.tags; var format = options.format; var modulePath = options.modulePath; @@ -52,6 +53,11 @@ module.exports = function (grunt) { execOptions.push(steps); } + if (! _.isEmpty(support)) { + execOptions.push('-r'); + execOptions.push(support); + } + if (! _.isEmpty(tags)) { execOptions.push('-t'); execOptions.push(tags);