This is a plugin of angular-mock, which support cucumberjs
npm install angular-midway Shell
npm install jquery --save-dev
npm install cucumber --save-dev
npm install karma-cucumber-js --save-dev
npm install angular-midway --save-dev
`
For more configuration information please see karma-cucumber-js
Step Definitions
Please ensure that you have already setup the environment according to karma-cucumber-js guidline.
And then in the step definition add additional callback, it's not a good way,
but you have to, I will improve it in the feature.
` JavaScript
__adapter__.addStepDefinitions(function (scenario) {
window.Cucumber.callback(scenario); // Don't forget to add this line
scenario.Given(/^there is a test step$/, function () { });
scenario.When(/^it is executed$/, function () { });
scenario.When(/^it is not executed$/, function (callback) { return callback.pending(); });
scenario.Then(/^test succeeds$/, function () { });
scenario.Then(/^test fails$/, function (callback) { return callback(new Error('Step failed')); });
});
``