Hacker0x01 / mocha-lazy-bdd

Lazy bdd interface for mocha that provides RSpec-style let/subject macros for ES5+ projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mocha Lazy BDD

This module provides a Lazy BDD interface to mocha. The interfaces is identical to the standard bdd interface, but also provides additional RSpec-style lazy/subject macros.

Example Spec

var expect = require('chai').expect;

describe('mocha-lazy-bdd', function() {
  
  describe('lazy', function() {
    
    lazy('value', function() {
      return 'i am lazy';
    });
    
    it('returns the specified value', function() {
      expect(this.value).to.eq('i am lazy');
    });
    
  });
  
});

See this project's specs for more examples.

Installation and Usage

npm install --save-dev mocha-lazy-bdd
mocha -u mocha-lazy-bdd

Or in a browser environment: install mocha-lazy-bdd via bower and then include the distribution before mocha has been setup.

About

Lazy bdd interface for mocha that provides RSpec-style let/subject macros for ES5+ projects.


Languages

Language:JavaScript 100.0%