༼ つ ◕‿◕ ༽つ
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.
From terminal:
npm install noh
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.