Socket
Book a DemoInstallSign in
Socket

tt

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tt

tiny tap test thing

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

tt

A very very small tap-emitting test framework.

This is not a test runner, but you can use tap as your test runner. Because tt outputs TAP formatted results, it'll get interpreted nicely.

USAGE

Do this in your test script:

var test = require('tt')

test('first test', function(t) {
  t.equal(2, 1 + 1, 'math works')
  t.equal(0.3, 0.1 + 0.1 + 0.1, 'except when it doesnt')
  t.test('child test', function(t) {
    t.pass('this will always pass')
    t.fail('this will never pass')
    t.end()
  })
  t.end()
})

test('second test', function(t) {
  t.ok(true, 'etc')
  t.end()
})

Run it with node my-test.js, or your favorite TAP-aware test runner thingie.

API

The function exported by require('tt') is the test function. Give it a name and a function. That function will get an argument object which has some assertion methods.

Every function from require('assert') are supported, but they output TAP data rather than throwing.

Also, you have t.pass(message), t.fail(message), t.comment(message), and t.test(name, fn).

Keywords

minimal

FAQs

Package last updated on 20 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts