The jest case fails even when the function when executes returns true. In the test case I am asserting toBeTruthy as the function returns true for the same argument.