@arckit/cucumber
v1.0.1
Published
Cucumber.js testing utilities for BDD step definitions
Downloads
231
Maintainers
Readme
@arckit/cucumber
Cucumber.js testing utilities for BDD step definitions.
📑 Table of Contents
- 🪧 About
- 📦 Installation
- 🚀 Usage
- 📖 API
- 🤗 Contributing
- 📝 License
DataTable assertion helper for Cucumber.js step definitions. Supports nested property access via dot notation and array indexing.
pnpm add -D @arckit/cucumberimport { assertMatchesDataTable } from '@arckit/cucumber';
Then(/^I should see the client$/, (dataTable: DataTable) => {
assertMatchesDataTable(dataTable)(client);
});With a DataTable like:
| Field | Value |
| name.firstname | Jean |
| name.lastname | Dupont |
| address.street | 123 Rue de la Paix |
| address.zipcode | 75001 |
| lines[0].label | Prestation |assertMatchesDataTable(dataTable: DataTable) => (actual: unknown, options?: { message?: string }) => void
| Parameter | Description |
|-----------|-------------|
| dataTable | A Cucumber DataTable with two columns: field path and expected value |
| actual | The object to assert against |
| options.message | Optional custom error message if the object is undefined |
Field paths support dot notation (name.firstname) and bracket notation for arrays (lines[0].label). Values are compared as strings using deepStrictEqual.
See CONTRIBUTING.md for details.
MIT © Marc Gavanier
