Cucumber.js testing utilities for BDD step definitions.
- 🪧 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