npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cucumber6-static-usage

v1.2.0

Published

Static usage formatter for cucumber-js v6

Downloads

4

Readme

cucumber6-static-usage

npm version

Static steps usage reporter for cucumber-js v6.

This reporter is inspired by the built-in usage reporter without limiting the matches to the first five: this reporter gives you the usage for all steps without any limitation, so the generated report might be huge.

To install this steps usage reporter

  • run the command:

    npm install --save cucumber6-static-usage

Usage

  • add to the cucumber-js command-line the following option:

    --format node_modules/cucumber6-static-usage:steps-usage.txt --dry-run

You should run cucumber-js in dry mode, because this reporter does not handle test execution results and durations.

What it generates

Here is a sample that corresponds to this feature file:

simple-maths.feature:

@foo
Feature: Simple maths
  In order to do maths
  As a developer
  I want to increment variables

Background: Calculator
  Given I have a simple maths calculator

Scenario: easy maths
  Given a variable is set to 11
  When I increment this variable by 1
  Then the variable should contain 12
  When I increment this variable by 2
  Then the variable should contain 14
  When I increment this variable by 2
  Then the variable should contain 16

Scenario Outline: much more complex stuff
  Given a variable is set to <var>
  When I increment this variable by <increment>
  When I increment this variable by 2
  Then the variable should contain <result>
  Examples:
    | var | increment | result |
    | 100 | 5         | 105    |
    | 99  | 1234      | 1333   |
    | 12  | 5         | 17     |

steps-usage.txt:

┌────────────────────────────────────────────┬────────┬─────────────────────────────────────────────────┐
│ Pattern / Text                             │ Usage  │ Location                                        │
├────────────────────────────────────────────┼────────┼─────────────────────────────────────────────────┤
│ I have a simple maths calculator           │ -      │ step-definitions/maths/simple-maths-steps.ts:5  │
│   I have a simple maths calculator         │ -      │ features/simple-maths.feature:8                 │
├────────────────────────────────────────────┼────────┼─────────────────────────────────────────────────┤
│ a variable is set to {int}                 │ -      │ step-definitions/maths/simple-maths-steps.ts:9  │
│   a variable is set to 11                  │ -      │ features/simple-maths.feature:11                │
│   a variable is set to <var>               │ -      │ features/simple-maths.feature:20                │
├────────────────────────────────────────────┼────────┼─────────────────────────────────────────────────┤
│ I increment this variable by {int}         │ -      │ step-definitions/maths/simple-maths-steps.ts:13 │
│   I increment this variable by 1           │ -      │ features/simple-maths.feature:12                │
│   I increment this variable by 2           │ -      │ features/simple-maths.feature:14                │
│   I increment this variable by 2           │ -      │ features/simple-maths.feature:16                │
│   I increment this variable by 2           │ -      │ features/simple-maths.feature:22                │
│   I increment this variable by <increment> │ -      │ features/simple-maths.feature:21                │
├────────────────────────────────────────────┼────────┼─────────────────────────────────────────────────┤
│ I foobar this variable by {int}            │ UNUSED │ step-definitions/maths/simple-maths-steps.ts:17 │
├────────────────────────────────────────────┼────────┼─────────────────────────────────────────────────┤
│ the variable should contain {int}          │ -      │ step-definitions/maths/simple-maths-steps.ts:21 │
│   the variable should contain 12           │ -      │ features/simple-maths.feature:13                │
│   the variable should contain 14           │ -      │ features/simple-maths.feature:15                │
│   the variable should contain 16           │ -      │ features/simple-maths.feature:17                │
│   the variable should contain <result>     │ -      │ features/simple-maths.feature:23                │
└────────────────────────────────────────────┴────────┴─────────────────────────────────────────────────┘

Control the size of the first column of the generated report

The reporter tries to infer a 'best' width for the first column of the report.

In some cases this value may not fit your needs; you can control the width of the first column by setting the environment variable STEPS_USAGE_REPORT_FIRST_COL_WIDTH:

process.env['STEPS_USAGE_REPORT_FIRST_COL_WIDTH'] = 150;