1.1.0 • Published 4 years ago
righto-tape v1.1.0
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();
});
});