tape-bdd

0.0.1 • Public • Published

tape-bdd Build Status NPM Version License Coverage Status

Tape-BDD essentially wraps tape and provides a more Mocha-style interface for BDD and automatically handling things like TAP planning and assertion names. It assumes one assertion per test.

Usage

var describe = require('tape-bdd');
 
describe('plus', function(it) {
  // assert has the same API as tape's test object
 
  // 'it' is a function that will handle thrown
  // errors gracefully and set the number of tests
  // for the suite for assert.plan().
 
  it('should add one and two', function(assert) {
    assert.equal(1 + 3, 3);
  });
 
  it('should add strings', function(assert) {
    assert.equal('foo' + 'bar', 'foobar');
  });
});

Is equivalent to:

var test = require('tape');
 
test('plus', function(t) {
  t.plan(2);
 
  t.equal(1 + 2, 3, 'should add one and two');
 
  t.equal('foo' + 'bar', 'foobar', 'should add strings');
});

Package Sidebar

Install

npm i tape-bdd

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • l8d