
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
karma-cucumber-js
Advanced tools
This is the #1 Cucumber.js adapter for Karma. In contrast to other adapters it supports latest version of Cucumber.js (1.3.1). This adapter does not include Cucumber.js. Cucumber.js and jQuery (required by cucumber-html) are peer dependencies.
npm install jquery --save-dev
npm install cucumber --save-dev
npm install karma-cucumber-js --save-dev
...
frameworks: ['cucumber-js'],
...
plugins: [
...
'karma-cucumber-js' // If you have plugins section then also specify this, you could omit it otherwise
...
],
...
files: [
// Feature files to test
{ pattern: 'features/*.feature', included: false },
... // Include JS files with step definitions and any other files they require
],
...
client: { // Specify this if you want to test features/scenarios with certain tags only
args: ['--tags', '@frontend']
},
...
reporters: ['bdd-json'], // Specify this reporter if you need to integrate test results into living documentation
bddJSONReporter: {
outputFile: 'results.json' // 'results.json' will be filled with all scenarios test results
},
...
In your step definitions files write them like this:
__adapter__.addStepDefinitions(function (scenario) {
scenario.Given(/^there is a test step$/, function () { });
scenario.When(/^it is executed$/, function () { });
scenario.When(/^it is not executed$/, function (callback) { callback(null, 'pending'); });
scenario.Then(/^test succeeds$/, function () { });
scenario.Then(/^test fails$/, function (callback) { callback(new Error('Step failed')); });
});
After getting adapter's code to build the adapter run the following command:
npm run build
Copyright (c) 2016 Eugene Shalyuk. This project is licensed under the terms of the MIT license.
FAQs
Karma adapter for running Cucumber.js features
The npm package karma-cucumber-js receives a total of 21 weekly downloads. As such, karma-cucumber-js popularity was classified as not popular.
We found that karma-cucumber-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.