Giter Site home page Giter Site logo

blaky / cucumber-steps-parser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from capelski/cucumber-steps-parser

0.0 1.0 0.0 63 KB

Parser to recognize and extract the cucumber sentences of step definition Typescript files

JavaScript 0.67% Gherkin 37.65% TypeScript 61.68%

cucumber-steps-parser's Introduction

cucumber-steps-parser

So you are using cucumber.js to test your Typescript project in a BDD fashion. That's a great choice! ๐ŸŽ‰ However, as the project grows, you start to have problems to remember all the step definitions you have created when writing new feature tests.

Here is where cucumber-steps-parser might come handy for you. This simple utility crawls a file or folder and looks for all the existing step definitions. Easy as that!

You can use it inside your application:

const { getFolderCucumberSentences } = require('cucumber-steps-parser');
const sentences = getFolderCucumberSentences('path/to/your/project');

And you can also run it from the terminal:

npm install --global cucumber-steps-parser
cucumber-steps-parser path/to/your/project

Options

You can customize how cucumber-steps-parser finds the step definition files in your application through the following configuration parameters:

  • recursive: Whether the folders found in the given path are recursively crawled. Defaults to true
  • filenameRegExp: Only the filenames matching this regular expression will be parsed. Defaults to typescript files only (/^.*\.ts$/)
const { getFolderCucumberSentences } = require('cucumber-steps-parser');
const sentences = getFolderCucumberSentences('path/to/your/project', {
    recursive: false,
    filenameRegExp: /^.*\.step\.ts$/
});
cucumber-steps-parser path/to/your/project --no-recursive --filename "^.*\.step\.ts$"

Have fun!

cucumber-steps-parser's People

Contributors

capelski avatar basalter avatar blaky avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.