Adding support for more negative testing.

Adding the ability to throw an error synchronously.
Adding the ability to emit an error asynchronously.