red-tape
red-tape extends tape to support generators and assertion errors such as those thrown by chai.
Features
- Supports generators, promises, etc, using co
- Catches errors rather than relying on assertion methods
- Shows stack traces for easy bug finding
Works well with
Installation
npm install red-tape --save-dev
Usage
'use strict'; var test = expect = expect; ; ; ; ;
API
require('red-tape')
Returns the Test.test
function, used to initiate a new test.
const test = ;;
Test.test(name, callback(t))
Runs a test. The callback is passed in a new Test
object as t
, and that
can be used for creating a sub-test.
;
Test.pass(msg)
Records the test as passed.
;
Test.fail(msg)
Records the test as failed.
;
Test.assert(value, msg)
Equivalent to:
if value t; else t;
;