Tests running.

The test wait for a mock email to go out, and check if there's any error or was it actually sent.
instead of console.logging we can tests those using `assert`