Mocha and generators (2)

I've blogged before about this topic and I had a problem when it comes to test exceptions. The problem is caused by Promise.spawn which returns a promise and swallow all errors thrown inside. To still get a failing test if an unexpected error is thrown, the following form should be used:

Et voila, this test will fail as expected.