node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »



Build Status Coverage Status Code Climate Known Vulnerabilities styled with prettier

GitHub license npm version Quality

JsGiven aims to bring BDD (Behavior-Driven Development) to plain (or typed) JavaScript.

It is a developer-friendly and pragmatic BDD tool for JavaScript.

Developers write scenarios in plain JavaScript using a fluent, domain-specific API, JsGiven generates reports that are readable by domain experts.

It's a JavaScript port of JGiven (written in Java). JsGiven keeps the JGiven philosophy, concepts and uses its html5 reporting tool.

You can have a look at JSGiven's own report

scenarios('recipes', RecipesStage, ({given, when, then}) => ({
    a_pancake_can_be_fried_out_of_an_egg_milk_and_flour: scenario({}, () => {

It can be used with any javascript test runner (like Jest, Ava, Mocha, Jasmine, or Protractor).

It can be used with your favorite assertion library (like ChaiJS, Jasmine), or your framework's assertion library.

It aims to provide the most comfortable developer experience with optional ES6 syntax, and optional FlowType or TypeScript typings.

Some features are missing, but we are already using it daily at

Don't hesitate to give any feedback and to open a GitHub issue

Getting started

You can start using JsGiven with the user guide