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.
Jasmine, Mocha and Vows can fall out of date and are a form of duplication. Yadda brings true BDD to JavaScript frameworks such as Jasmine, Mocha, QUnit, Nodeunit, WebdriverIO and CasperJS. By true BDD we mean that the ordinary language (e.g. English) steps are mapped to code, as opposed to simply decorating it. This is important because just like comments, the decorative steps such as those used by
Yadda's BDD implementation is like Cucumber's in that it maps the ordinary language steps to code. Not only are the steps less likely to go stale, but they also provide a valuable abstraction layer and encourage re-use. You could of course just use CucumberJS, but we find Yadda less invasive and prefer it's flexible syntax to Gherkin's. Yadda's conflict resolution is smarter too.
The current version of Yadda is 2.2.0
Please refer to the the Yadda User Guide.
.
├── bottles-test.js
├── lib
│ └── wall.js
└── test
├── features
│ └── bottles.feature
└── steps
└── bottles-library.js
./test/features/bottles.feature
Feature: 100 Green Bottles
Scenario: Should fall from the wall
Given 100 green bottles are standing on the wall
When 1 green bottle accidentally falls
Then there are 99 green bottles standing on the wall
./test/steps/bottles-library.js
var assert = require('assert');
var English = require('yadda').localisation.English;
var Wall = require('../../lib/wall'); // The library that you wish to test
module.exports = (function () {
return English.library()
.given('$NUM green bottles are standing on the wall', function (number, next) {
wall = new Wall(number);
next();
})
.when('$NUM green bottle accidentally falls', function (number, next) {
wall.fall(number);
next();
})
.then('there are $NUM green bottles standing on the wall', function (number, next) {
assert.equal(number, wall.bottles);
next();
});
})();
(If your test runner & code are synchronous you can omit the calls to 'next')
./bottles-test.js
var Yadda = require('yadda');
Yadda.plugins.mocha.StepLevelPlugin.init();
new Yadda.FeatureFileSearch('./test/features').each(function (file) {
featureFile(file, function (feature) {
var library = require('./test/steps/bottles-library');
var yadda = Yadda.createInstance(library);
scenarios(feature.scenarios, function (scenario) {
steps(scenario.steps, function (step, done) {
yadda.run(step, done);
});
});
});
});
./lib/wall.js
module.exports = function (bottles) {
this.bottles = bottles;
this.fall = function (n) {
this.bottles -= n;
};
};
mocha --reporter spec bottles-test.js
100 Green Bottles
Should fall from the wall
✓ Given 100 green bottles are standing on the wall
✓ When 1 green bottle accidentally falls
✓ Then there are 99 green bottles standing on the wall
[2.2.0]
FAQs
A true BDD framework for JavaScript
The npm package yadda receives a total of 460 weekly downloads. As such, yadda popularity was classified as not popular.
We found that yadda 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.
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.