Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
A domain rules engine based on Gherkin syntax
WARNING: this project is still highly experimental and its API may change in the future!
NOTE: while experimental, feedback is encouraged and really welcome!
The Gherkin syntax and the cucumber
project have made writing
and execuring acceptance tests a very easy and efficient activity.
However, writing the real domain code could still be a very complex and risking challenge.
In a LEAN and Agile world, requirements may change a lot along the development lifecycle. The impact of complex code refactoring can be devastating for teams, companies and client's investment.
That's the idea: why don't model the domain logic using the same approach used to write the acceptance tests?
The main advantages of this approach are:
First of all, let's install Tzatziki:
$ npm install --save tzatziki
We can now create features and scenarios using the Tzatziki API:
const Tzatziki = require('tzatziki')
const tzatziki = new Tzatziki()
// Create a feature for our business domain:
const feature = tzatziki.createFeature('User profile', 'As user, I request my profile details')
const scenario = feature.createScenario('A user requests her profile')
scenario.Given('a user')
scenario.When('she requests her profile')
scenario.Then('her details are returned')
// Then, populate the dictionary of definitions to provide the logic:
tzatziki.dictionary.Given('a user', function () { ... })
tzatziki.dictionary.When('she requests her profile', function () { ... })
tzatziki.dictionary.Then('her details are returned', function () { ... })
feature
.exec(tzatziki.dictionary)
.catch(err => console.log(err))
Alternatively, we can also use features written in Gherkin syntax to model our domain logic:
const Tzatziki = require('tzatziki')
const tzatziki = new Tzatziki()
// Cucumber-style methods can be used:
const { Given, When, Then } = tzatziki.cucumber()
Given('a user', function () { ... })
When('she requests her profile', function () { ... })
Then('her details are returned', function () { ... })
// Parse an existing feature file:
tzatziki
.parse('features/example.feature')
.then(feature => feature.exec(tzatziki.dictionary))
$ npm test
This project is kindly sponsored by:
Licensed under MIT
FAQs
A domain rules engine based on Gherkin syntax
The npm package tzatziki receives a total of 0 weekly downloads. As such, tzatziki popularity was classified as not popular.
We found that tzatziki 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.