
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
@types/cucumber
Advanced tools
@types/cucumber provides TypeScript definitions for the Cucumber testing framework, allowing developers to write Cucumber tests in TypeScript with type safety and autocompletion.
Define Step Definitions
This feature allows you to define step definitions in TypeScript using Cucumber's Given, When, Then syntax. It provides type safety and autocompletion for writing step definitions.
import { Given, When, Then } from 'cucumber';
Given('a precondition', function () {
// Write code here that turns the phrase above into concrete actions
});
When('an action is performed', function () {
// Write code here that turns the phrase above into concrete actions
});
Then('expect a result', function () {
// Write code here that turns the phrase above into concrete actions
});
Define Hooks
Hooks are functions that run at specific points in the Cucumber execution cycle. This feature allows you to define hooks in TypeScript, providing a way to set up and tear down test environments with type safety.
import { Before, After } from 'cucumber';
Before(function () {
// This hook will be executed before each scenario
});
After(function () {
// This hook will be executed after each scenario
});
Data Tables
Data tables allow you to pass structured data to your step definitions. This feature provides type definitions for working with data tables in TypeScript, ensuring type safety and better code readability.
import { Given } from 'cucumber';
Given('a table of data', function (dataTable) {
const data = dataTable.raw();
// Use the data table in your step definition
});
jest-cucumber is a package that allows you to use Cucumber-style Gherkin syntax with Jest. It provides a similar BDD approach but is integrated with the Jest testing framework, which is popular for its speed and ease of use compared to Cucumber.
cypress-cucumber-preprocessor enables the use of Cucumber Gherkin syntax with Cypress, a popular end-to-end testing framework. It combines the power of Cucumber's BDD approach with Cypress's fast and reliable testing capabilities, offering an alternative to using Cucumber directly.
CodeceptJS is an end-to-end testing framework that supports BDD-style testing with Gherkin syntax. It provides a similar feature set to Cucumber but is designed to work with multiple backends like WebDriver, Puppeteer, and TestCafe, offering more flexibility in testing environments.
npm install --save @types/cucumber
This package contains type definitions for cucumber-js (https://github.com/cucumber/cucumber-js).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cucumber/v1
Additional Details
These definitions were written by Abraão Alves https://github.com/abraaoalves, Jan Molak https://github.com/jan-molak, Isaiah Soung https://github.com/isoung.
FAQs
Stub TypeScript definitions entry for @cucumber/cucumber, which provides its own types definitions
The npm package @types/cucumber receives a total of 160,282 weekly downloads. As such, @types/cucumber popularity was classified as popular.
We found that @types/cucumber demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.