casthewiz / noh

Add some character to your unit testing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

noh

༼ つ ◕‿◕ ༽つ

noh provides simple assert functionality with emojis.
Because sometimes assertions need a little more character :)

noh also includes basic logging messages and an execution timer.

Installation

From terminal: npm install noh

Usage

wearNoh is a decorator function that wraps any function you give it with asserts, logging, and a noh emoji.

wearNoh( f , e )
//Where f is the function to be wrapped
//and e is asserted to be f's return value.

This snippet demonstrates an example of usage.

var noh = require('noh')
var assertValue = 2
function returnArg(arg){return arg}

var example = noh.wearNoh(returnArg, assertValue)
example(2); //Pass with pass logging
example(3); //Fail with failure logging

On each call of example(), it's return value will be checked against assertValue, with subsequent logging.

About

Add some character to your unit testing.


Languages

Language:JavaScript 100.0%