1.0.0 • Published 10 years ago

tess v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

tess

Simple test runner.

npm.io

Use

$ npm install --save-dev tess
// test.js

var assert = require('assert')
var tess = require('tess')

tess(function(it) {
  it('works', function() {
    assert(true)
  })
})

API

var results = tess(opts , suite)

opts

  • (optional)
  • Type: Object|String
opts.name
  • Type: String A label for this suite of tests. You may also pass this in in place of the opts object.
opts.shh
  • Type: Boolean Won't print test results to stdout.

suite

  • Type: Function Encapsulates all of your tests.

When invoked, this function will receive a function as its first argument.

suite(function(title, fn) {})
title
  • Type: String The name to assign to your test.
fn
  • Type: Function The function that wraps your assertions.

results

  • Type: Array The results of all of your tests after running them.
results[].fn
  • Type: Function The function that was tested.
results[].success
  • Type: Boolean Signals if the test succeeded or failed.
results[].title
  • Type String The name of the test that was run.
results[].error
  • Type: Object If the test failed, this contains the error object.