Can you add a test where you expect the function not to throw? That may also help to demonstrate how the function should be called correctly.