Run assertions against your objects. Define contracts with a handy DSL. Test your code inline.
Assertron lets you run assertions against objects via a convenient DSL:
import {assert as A} from 'assertron';
function myFunc(foo, bar) {
A(foo, {object: true});
A(bar, {
optional: true,
or: {
number: {
min: 3,
max: 10,
orString: true
},
function: true
}
})
/* Your function's code here */
}