Socket
Socket
Sign inDemoInstall

gherkin-preprocessor

Package Overview
Dependencies
124
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gherkin-preprocessor

Allows some preprocessing tecniques for Gherkin files, such as importing partials and if statements


Version published
Maintainers
1
Install size
3.10 MB
Created

Readme

Source

Gherkin preprocessor

Allows some preprocess tecniques for Gherkin files, such as including partials or evaluating if statements.

Directive syntax

This module leverage on the preprocess module, so check its documentation for directive's syntax. Just make sure to place them in a Gherkin comment:

#@include ../../partials/_go_to_cart.feature

Installation

Install gherkin-preprocessor as a common node module, either locally or globally:

npm install [-g] gherkin-preprocessor

or clone the repo https://github.com/fbedussi/gpp and install it as a module with npm link.

Usage

buildGherkin [optionName=option] [optionName=option] [optionName=option]

Options

source

Default: 'features_src'

buildGherkin source=mySourceFolder

The source folder path (relative or absolute)

dest

Default: 'features'

buildGherkin dest=myDestFolder

The destination folder path (relative or absolute)

w

buildGherkin w

Watch source folder for changes

exclude

Default: 'partials'

buildGherkin exclude=myPartial

The name of the folder to exclude

excludeRegExp

buildGherkin excludeRegExp=partial|otherFolder

The regExp pattern to match the folder(s) to exclude

env

buildGherkin env=prod

The name of the environment in which the Gherkin is intended to run, e.g. "prod", "dev", ecc. This variable could be used in if statements:

#@if env='prod'
@prod
#@endif
#@if env='dev'
@dev
#@endif

The code above will render the @prod tag in the compiled Gherkin if env is set to prod, or the tag @dev if it's set to dev.

varFile

buildGherkin varFile=myVar.json

The path to a json file containing the variables to be used by the preprocessor in if statements.

Examples

buildGherkin source=mySourceFolder dest=myDestFolder exclude=myPartial

Keywords

FAQs

Last updated on 05 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc