MCPcopy Create free account
hub / github.com/cucumber/cucumber-js

github.com/cucumber/cucumber-js @v13.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v13.0.0 ↗ · + Follow
675 symbols 1,856 edges 283 files ⚖ MIT 3 documented · 0% 12 cross-repo links ● updated todayv13.3.0 · 2026-10-05★ 5,40734 open issues

Browse by type

⨍ Functions 452◇ Types & classes 223
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Cucumber

Automated tests in plain language, for Node.js

Latest version on npm Coverage OpenSSF Scorecard Backers Sponsors Ukraine solidarity

Build status Release status

Cucumber is a tool for running automated tests written in plain language. Because they're written in plain language, they can be read by anyone on your team. Because they can be read by anyone, you can use them to help improve communication, collaboration and trust on your team.

This is the JavaScript implementation of Cucumber. It runs on maintained versions of Node.js. You can quickly try it via CodeSandbox, or read on to get started locally in a couple of minutes.

Looking to contribute? Read our code of conduct first, then check the contributing guide to get up and running.

Install

Cucumber is available on npm:

npm install @cucumber/cucumber

Get Started

Let's take this example of something to test:

First, write your main code in src/index.js:

class Greeter {
  sayHello() {
    return 'hello'
  }
}

module.exports = {
  Greeter
}

Then, write your feature in features/greeting.feature:

Feature: Greeting

  Scenario: Say hello
    When the greeter says hello
    Then I should have heard "hello"

Next, implement your steps in features/support/steps.js:

const assert = require('assert')
const { When, Then } = require('@cucumber/cucumber')
const { Greeter } = require('../../src')

When('the greeter says hello', function () {
  this.whatIHeard = new Greeter().sayHello()
})

Then('I should have heard {string}', function (expectedResponse) {
  assert.equal(this.whatIHeard, expectedResponse)
})

Finally, run Cucumber:

npx cucumber-js

And see the output:

Terminal output showing a successful test run with 1 scenario and 2 steps, all passing

If you learn best by example, we have a repo with several example projects, that might help you get going.

Documentation

The following documentation is for main, which might contain some unreleased features. See documentation for older versions if you need it.

Support

Support is available from the community if you need it.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 266
Method 186
Interface 130
Class 91
Enum 2

Languages

TypeScript100%

Modules by API surface

src/formatter/json_formatter.ts25 symbols
src/support_code_library_builder/index.ts21 symbols
src/runtime/test_case_runner.ts20 symbols
src/pickle_filter.ts19 symbols
src/plugin/plugin_manager.ts16 symbols
src/api/types.ts15 symbols
src/formatter/helpers/event_data_collector.ts14 symbols
src/runtime/attachment_manager/index.ts13 symbols
features/support/message_helpers.ts13 symbols
src/runtime/scope/make_proxy.ts12 symbols
src/runtime/parallel/adapter.ts12 symbols
src/support_code_library_builder/types.ts11 symbols

Dependencies from manifests, versioned

@biomejs/biome2.4.16 · 1×
@cucumber/biome-configgithub:cucumber/biom · 1×
@cucumber/ci-environment13.0.0 · 1×
@cucumber/compatibility-kit29.0.0 · 1×
@cucumber/cucumber-expressions19.0.1 · 1×
@cucumber/gherkin39.1.0 · 1×
@cucumber/gherkin-streams6.0.0 · 1×
@cucumber/gherkin-utils11.0.0 · 1×
@cucumber/html-formatter23.1.0 · 1×
@cucumber/junit-xml-formatter0.13.3 · 1×
@cucumber/message-streams4.1.1 · 1×
@cucumber/messages32.3.1 · 1×

For agents

$ claude mcp add cucumber-js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page