righto-tape
v1.1.0
Published
[![Build Status](https://travis-ci.org/markwylde/righto-tape.svg?branch=master)](https://travis-ci.org/markwylde/righto-tape) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/markwylde/righto-tape) [![GitHub package.json vers
Downloads
11
Readme
righto-tape
A small wrapper around tape that allows passing a righto/generator into the test function
Installation
npm install --save-dev righto-tape
Usage
const { promisify } = require('util');
const righto = require('righto');
const test = require('righto-tape');
const sleepCallback = (ms, callback) => setTimeout(callback, ms);
const sleepPromise = promisify(sleepCallback);
test('takes a promise', function * (t) {
t.plan(1);
yield sleepPromise(100);
t.pass();
});
test('takes a righto', function * (t) {
t.plan(1);
yield righto(sleepCallback, 100);
t.pass();
});
test('takes a normal function', function (t) {
t.plan(1);
sleepCallback(100, function () {
t.pass();
});
});