Allow functions to be passed to expect