Testing async code with Mocha using callbacks and promises
Testing async code with Mocha using callbacks is pretty straight forward, all you need to do is pass the done function down the callback chain and ensure it is executed after your last assertion: