Write tests for ifElse
function that takes 3 callbacks condition
, first
and
second
and runs condition
with no arguments. If condition
returns true
run a first
callback otherwise run second
with no arguments. No result is
expected from isElse
function.
ifElse(
() => Math.random() > 0.5,
() => console.log(1),
() => console.log(2),
); // 1 is printed if random value > 0.5
- Guideline
- Read more about Jest expectations