1
0
Go to file
2024-12-19 23:54:35 +01:00
1args Remove babel from the tutorial, assertion, async 2024-12-19 23:54:35 +01:00
2obj Remove babel from the tutorial, assertion, async 2024-12-19 23:54:35 +01:00
3bg Remove babel from the tutorial, assertion, async 2024-12-19 23:54:35 +01:00
4outline Remove babel from the tutorial, assertion, async 2024-12-19 23:54:35 +01:00
assertion Remove babel from the tutorial, assertion, async 2024-12-19 23:54:35 +01:00
async Remove babel from the tutorial, assertion, async 2024-12-19 23:54:35 +01:00
data-tables Add example with non-standard formatters 2018-12-30 06:43:46 +01:00
formatter Add example with non-standard formatters 2018-12-30 06:43:46 +01:00
reuse reuse: Apply function with Ramda and Lodash 2019-01-03 06:11:13 +01:00
ts Add missing space and semicolons 2019-01-03 06:12:27 +01:00
type-parser Create a branch with custom parameters 2018-12-24 20:19:20 +01:00
.gitignore Add code 2018-11-10 20:06:38 +01:00
LICENSE Initial commit 2018-11-09 21:21:42 +01:00
README.md Add node, chai, jest diff comparison 2018-12-31 07:44:25 +01:00

Cucumber.js examples

This repository demonstrates features of Cucumber.js. Each directory contains an independent npm-package with an example.

The packages have standard directory structure:

  • Features are in the feature/ directory and have .feature extension.
  • Step definitions are JavaScript files in feature/steps/.

Running the tests

  1. Go to a directory
  2. Install npm dependencies:
npm install
  1. Run the tests:
npm test

Available examples

1-5

The directories with the names starting with a number are parts of a single step-by-step guide which introduces Cucumber.js. Each step of this guide builds on the previous one and contains a few more lines of JavaScript code.

The target project is a small test suite for the JavaScript + operator.

data-tables

When data tables are used, Cucumber.js provides different views of the data. This directory contains one feature with four scenarios, each of which uses a different way to read the given table. These tests cover all possibilities to access the data in a data table.

See Data tables.

async

Shows how to use promises and async/await when testing asynchronous code.

ts

Defining steps in TypeScript.

type-parser

Defines custom parameter types.

reuse

Suggests a way to reuse step definitions.

formatter

Uses non-default output formatter. See package.json.

See also:

assertion

This package contains some failing tests demonstrating object diffs provided by node's native asserts, chai and jest.