app as a function to run it in tests