testit
Because the world needs a simpler testing framework
Last updated 2 years ago by robloach .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install testit 
SYNC missed versions from official npm registry.

testit

Because the world needs a simpler testing framework. Check out the travis build log for an example of test output and check out the test folder for an example test suite.

This module also works seamlessly with istanbul for code coverage (see package.json) and sauce-test for browser testing via browserify.

Build Status Coverage Status Dependency Status NPM version

Sauce Test Status

Installation

npm install testit

Sample test script

var assert = require('assert')
var test = require('testit')

test('synchronous tests', function () {
  test('passes tests that do not fail', function () {
    assert(true)
  })
  test('fails tests that fail', function () {
    assert(false)
  })
})

test('asynchronous tests with callbacks', function () {
  test('passes some async tests', function (done) {
    setTimeout(done, 100)
  })
  test('fails some async tests', function (done) {
    setTimeout(function () {
      done(new Error('oh dear'))
    }, 100)
  })
  test('times out some tests', function (done) {
    setTimeout(function () {
      done()
    }, 99999999999)
  })
  test('supports custom timeouts', function (done) {
    setTimeout(done, 1000)
  }, {timeout: '1 second'})
})
test('supports promises just as well as callbacks', function () {
  return new Promise(function (resolve) {
    setTimeout(resolve, 100)
  })
})

License

MIT

Current Tags

  • 3.1.0                                ...           latest (2 years ago)

16 Versions

  • 3.1.0                                ...           2 years ago
  • 3.0.0                                ...           3 years ago
  • 2.1.4                                ...           3 years ago
  • 2.1.3                                ...           4 years ago
  • 2.1.2                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.5                                ...           5 years ago
  • 2.0.4                                ...           5 years ago
  • 2.0.3                                ...           5 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Downloads
Today 0
This Week 0
This Month 32
Last Day 0
Last Week 16
Last Month 7
Dependencies (6)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |