1. testit
Because the world needs a simpler testing framework
testit
Package: testit
Created by: ForbesLindesay
Last modified: Mon, 27 Jun 2022 05:29:58 GMT
Version: 3.1.0
License: MIT
Downloads: 515
Repository: https://github.com/ForbesLindesay/testit

Install

npm install testit
yarn add testit

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

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code