Gherkin to mocha
a webpack loader which will convert gherkin feature files to mocha test suites.
Example webpack config:
moduleexports = module: rules: test: /\.feature$/ exclude: /node_modules/ use: loader: 'gherkin-to-mocha' options: // the step defintions relative to the feature file // you have to provide an index.js file which imports all your // step definitions and hooks pathToStepDefintions: "../support/step_definitions" // tag expression for features and scenarios to skip skipTagExpression: "@skip or @ignore" //tag expression for features and scenarios to focus on onlyTagExpression: "@only or @focus" ;
Support for given, when, then, and, but steps, including matched arguments and docstring/datatable as last argument:
; ; ; ; ;
Support for Cucumber Expressions:
; // Define your own tokens beside the default int, float, word and string// IMPORTANT: Define custom tokens always before the steps gets defined (e.g. import custom tokens first); ;
Support for hooks before and after features, scenarios and steps with tags including inherited tags:
; ; ; ; ; ;
Support for hooks with tag expression:
; ;