Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@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
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, BendingBender https://github.com/BendingBender, ErikSchierboom https://github.com/ErikSchierboom.
FAQs
Stub TypeScript definitions entry for @cucumber/cucumber, which provides its own types definitions
The npm package @types/cucumber receives a total of 132,651 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.