
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
bdd-lazy-var
Advanced tools
Provides "ui" for mocha.js which allows to define lazy variables and subjects
Provides "ui" for mocha.js which allows to define lazy variables and subjects.
npm install bdd-lazy-var --save-dev
Browser version: bdd-lazy-var.js
.Node version: index.js
.
Command line: mocha -ui bdd-lazy-var
or in JavaScript:
var mocha = new Mocha({
ui: 'bdd-lazy-var'
});
subject
accessor as alias for def('subject', ...)
and get('subject')
subject
inside subject
definition will refer to parent's subejct
)describe('Suite', function() {
def('fullName', function() {
return get('firstName') + '+' + get('lastName');
});
def('firstName', 'BDD');
def('lastName', 'Lazy variable');
it('computes variables', function() {
expect(get('fullName')).to.equal('BDD+Lazy variable');
});
describe('Nested suite', function() {
def('fullName', function() {
return get('fullName') + '!'; // get parent's "fullName" variable
});
it('gets parent variable', function() {
expect(get('fullName')).to.equal('BDD+Lazy variable!');
});
});
describe('Another nested suite', function() {
def('lastName', 'Rocks!');
it('redefines parent variable', function() {
expect(get('fullName')).to.equal('BDD+Rocks!');
});
});
describe('with subject', function() {
subject(function() {
return {};
});
it('defines subject', function() {
expect(subejct()).to.be.an('object');
});
});
});
FAQs
Provides "ui" for testing frameworks such as mocha/jasmine which allows to define lazy variables and subjects
The npm package bdd-lazy-var receives a total of 13,002 weekly downloads. As such, bdd-lazy-var popularity was classified as popular.
We found that bdd-lazy-var 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.