ilkkao / co-mocha

Co-mocha
MIT License
26 stars 2 forks source link

Coffee tests don't work #7

Open timkinnane opened 7 years ago

timkinnane commented 7 years ago

There seems to be a conflict in coffee-script tests.

There's one issue not specific to mocha-co but worth being aware of because it complicates things, which is that Coffee will automatically compile functions containing yield into generators - that also breaks the block scope for tests, because it doesn't use a fat arrow. So the @ (this) which would otherwise provide a consistent scope between forEach and it functions is no longer available.

The main problem I've found is that if there's an error in the generator, or even a console log, neither will make it back up to mocha or output in test results. They just seem to be suppressed within the function, so I've found after hours of testing that some predicate tests were actually failing silently, even though they appeared to pass.