You get the error you are getting because your top level
before hook takes more than the default 2000ms timeout delay to run. In case you did not know:
before means "execute this before all tests in this suite" and this is why the error message talks of a "before all" hook.
It works when you do
$ mocha -b -R spec -s 1000 -t 3000 because you've increased the timeout to 3000ms. The code in your before hook takes between 2 and 3 seconds to run. You could make this setting permanent by putting it inside