1.1.0 • Published 4 years ago

righto-tape v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

righto-tape

Build Status GitHub code size in bytes GitHub package.json version GitHub js-semistandard-style

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();
  });
});
1.1.0

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.0

4 years ago