expecto('cast', patronum => {...})
Function with predicates
Not supposed to have a lot of usage, it's made just for fun.
npm i expecto-patronum
import { expecto } from 'expecto-patronum'
expecto(
'All tests should PASS',
patronum => {
patronum(0).beFalsy()
patronum(1).beEqual(1)
patronum(2).beSame(2)
patronum(3).beTruthy()
patronum({ a: 'a', b: 'b' }).beEquallyStringified({ a: 'a', b: 'b' })
},
tests => console.log(tests)
)
expecto(
'All tests should FAIL',
patronum => {
patronum(1).beFalsy()
patronum(2).beEqual(3)
patronum([]).beSame([])
patronum(0).beTruthy()
patronum({ a: 'a', b: 'b' }).beEquallyStringified({ b: 'b', a: 'a' })
},
console.log
)