whew

A simple, pretty, and lightweight Node.JS testing framework

Installation

npm install whew

Or, for distribution with your package...

npm install whew --save

Simple usage

cosnt w = require ( " whew " ) ; w . add ( " This works. " , ( res ) => { res ( true , " See? " ) ; } ) ; w . add ( " Adding numbers " , ( res ) => { var added = 3 + 4 ; res ( ( added === 7 ) , " Resulted in 3 + 4 = " + added ) ; } ) ; w . add ( " My bad " , ( res ) => { res ( false , " I've failed you! " ) ; } ) ; w . test ( ) ;

API: Really quick explanation

I'll explain how this works as quickly as possible so you can get right to testing.

First, of course, we require the library.

const w = require ( " whew " ) ;

Then we create a test.

w . add ( " Test name " , ( res ) => { res ( true , " Optional description here " ) ; } ) ;

The callback method provided to the test can be called with the following parameters:

Passed? Boolean

Description String Optional

Then, of course, we actually execute the tests.

w . test ( ) ;

Simple, isn't it?

Simple demo: Multi-file testing

It's crazy simple to keep your tests organized within multiple files. Here's a demo...

test.js (Main test file)

const w = require ( " whew " ) ; w . add ( " Adding numbers " , require ( " ./addingNumbersTest.js " ) ) ; w . test ( ) ;

addingNumbersTest.js