tape-bdd
v0.0.1
Published
BDD-style wrapper for tape
Downloads
4
Maintainers
Readme
tape-bdd
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');
});