noh

Assertions with timers and character.

Usage no npm install needed!

<script type="module">
  import noh from 'https://cdn.skypack.dev/noh';
</script>

README

noh

༼ つ ◕‿◕ ༽つ

noh provides simple assert functionality with emojis.
Because sometimes, failed tests deserve frowns and passes get smiles.

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.