Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Add basic multilevel describe/it bdd constructs to expresso

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
README.md

Adds simple BDD to the expresso TDD framework

This project adds a simple extension to the expresso framework which translates a nested "describe"/"it should" structure into a flattened object that expresso will run.

expressobdd includes the 'should.js' framework so you get access to the BDD 'should' style assertions without needing to explicitly include it.

Usage

Here's an example of how to use expessobdd in a file in 'test/mytest.js':

module.exports = require('expressobdd')({
    'a test group': {
        'test a': function() {
            var x = 3;
            x.should.eql(3);
        },

        'test b': function() {
            var y = 4;
            y.should.eql(4);
        },

        'another group': {
            'test c': function() {
                var x = 3;
                x.should.eql(3);
            },

            'test d': function() {
                var y = 4;
                y.should.eql(4);
            },
        },
    },

    'it should be a simple test': function() {
        var x = 2;
        x.should.eql(2);
    },
});

Then you can run the test above by: $ expresso

Installation

expressobdd is made available through the npm package system. To install just:

$ npm install expressobdd
Something went wrong with that request. Please try again.